# A few questions about programming on a V350.

## Recommended Posts

So after a bunch of trial and error I'm happy to say I've made some good progress on teaching myself how to program decently complex things, but a few things elude me so hopefully the questions I have aren't too obvious.

1. I have 2 sensors that I need to hook up to the PLC and I'm having trouble figuring out exactly what I need to do for it, I've looked up some posts on here about it but none of them seem to apply. It's a 4-20mA analog input that reads pH levels, but I'm not exactly sure what the linearization inputs (X1, Y1, X2, Y2, Y) should be.  If there's a guide or example program about that all I need is a point in the right direction.

This is the sensor we have - https://www.sensorex.com/docs/specs/SpecsS600Inline.pdf

2. Is there any way to make a timer that counts up? I came up with a convoluted way of doing that using a timer set at max time and subtracting it from that number, but I feel like there's a simpler way to do that I'm missing.

3. For sending an email through a PLC is an SD card required? The example program (Joe Tauser's) that I got from here has inputs for the email text and all of that and it seems to hold all the information I need to put on it so can I not use the SD card in that case?

Thanks for the assistance, if there's any other information I can send that would be helpful just let me know.

##### Share on other sites

• MVP 2023

1.  The values that go in your linearization block depend on the type of analog input you are using.  Analog input modules such as the ATC8 use 14 bit analog (0-16384) and the onboard analog on the PLC itself is usually 10 bit (0-1023).  A linear block is a computerized line - for every X you get a Y.  You have to define the ends of the line.

For a 4/20 input, the line starts at 20% up the A/D output.  In the case of an ATC8, that's equal to 0.2 * 16384 or ~3277.  So your input values are 4 mA = 3277 to 20 mA = 16384.   X1 = 3277,  X2 = 16384.   Your sensor has this pH output;  4/20 = 0 - 14.   So giving yourself some virtual decimal places, Y1 = 0 and Y2 = 1400.

X is the MI you assigned to the analog input.  This is the argument for the block.  The MI for Y is the block's output, or your scaled value.

2.  If all you want to do is display the timer's value counting up, use the Timer variable and select Elapsed time.  If this is for use in your logic, you'll have to roll your own "timer" using a time pulse such as SB 13 incrementing an MI.  I do this all the time, as it gives me a lot more flexibility on what I do with the value in the MI using compare or reset blocks.

3.  You don't need an SD card for email, but you do need a non-SSL mail server.  These are getting very hard to come by.

Joe T.

• 1
##### Share on other sites

Thank you so much Joe, that all makes sense. I was on the cusp of some of those but that would have taken me quite a bit to get to that conclusion on my own.

I'll update this if there's any issues that arise.

##### Share on other sites

Okay so I do have a follow-up question. The sensor that I'm using measures ORP and pH, how do I differentiate the two when it's only 1 input?

##### Share on other sites

• MVP 2023

Initial reaction - you don't.  You need two inputs, unless there's some input to the sensor to shift the ORP and the pH values on the same wires.

The data sheet you posted didn't have wiring information.  How does the sensor report these values?

Joe T.

• 1
##### Share on other sites

• MVP 2023

My read on the pdfs is that the name "combination" may have lead you astray.  I think it is a separate sensor needed for each type of read.  Note the different part no.s for pH or ORP.

I've never seen a sensor with pH and ORP in one unit.  But not saying they don't exist.

cheers,

Aus

##### Share on other sites

• MVP 2023

Looked over the transmitter sheet.  All you get is one output.

There's something about using a hammer for installation on page 5.  Make sure you do this.

Joe T.

• 1
##### Share on other sites

So I have the inputs and outputs all sorted, but the input coming from the sensor is reading as 1024 for sensor A and 0 for sensor B which doesn't seem to make any sense. The sensor is in a pH buffer of 4, but it also stays at exactly 1024/0, which seems off because it should fluctuate at least slightly.

Edit - Added pictures to see if it's something obvious that I'm just missing. I have it set to the 10bit numbers because I'm just using the onboard analog inputs of the V350-35-r34.

The wiring is:

Sensor ---> Pathfinder Transmitter ---> + (Power Supply)
GND (GND)

http://pathfinderinstruments.com/ph/orp-transmitters/pathfinder-emit-ph/
http://pathfinderinstruments.com/ph/orp-transmitters/pathfinder-emit-orp/

Transmitters in question.

##### Share on other sites

Are JP1&2 jumpers in A position? Default has them as DI's.  It would help to take screenshots while in online mode. I assume the zero and 1024 values are direct read from MI14 and MI17?

##### Share on other sites

• MVP 2023

+1 to Hots on the jumpers.

My experience was only with public swimming pools, but I'm sure that the same principles apply across any installation.  The pH and ORP sensors I used always needed time in the solution to become stable, especially new sensors which could take anywhere up to a few hours to become accurate and were usually way off to start with.

cheers,

Aus

##### Share on other sites

with PLC powered off, put ohm meter between AI and ground (0V). you should see around 37 ohms. quick way to ID a potential hardware issue.

##### Share on other sites

Okay, so in my haste to get it set up I seem to have forgotten the 250ohm resistor. If that doesn't cause it to be correct then I will try these suggestions and get back to you guys.

On 2/10/2018 at 9:07 PM, Ausman said:

+1 to Hots on the jumpers.

My experience was only with public swimming pools, but I'm sure that the same principles apply across any installation.  The pH and ORP sensors I used always needed time in the solution to become stable, especially new sensors which could take anywhere up to a few hours to become accurate and were usually way off to start with.

cheers,

Aus

We ran them over the weekend as per the instructions on the sensors, so hopefully they should be stable when I test them again.

Thanks for all the help though, definitely a little out of my element with these so it's a learning experience.

##### Share on other sites

This is it when it is online.

The 3 on there is bouncing between 0-4 every cycle, but that isn't a value it should be getting. And the 2 large negative numbers in the unused MI's make no sense to me.

I have the Inputs set up as such...

##### Share on other sites

• MVP 2023

It shouldn't make any difference to your results, but it might.  Do an Initialise and Reset.  Under Connection/Communication & OS/2nd Tab Bottom right.

That should clear up your MI8 & 9 at least.  If it doesn't, then something is astray.  Advise back.

cheers, Aus

##### Share on other sites

• MVP 2023

And you definitely have the jumpers set correctly?

##### Share on other sites

+1 Aus,  250 ohm resistor in series probably won't make any difference .  I would definitely confirm the jumper placement .

##### Share on other sites

• MVP 2023

And you definitely have the wiring correct as per page 8 of https://myzone-kza3sadj.netdna-ssl.com/wp-content/uploads/2015/12/Vxxx_J_TR34_R34_INSTAL_GUIDE_11-14.pdf

These sensors must have really good connections due to the miniscule voltages they work with.  I used to actually get rid of the sockets/plugs and direct solder onto the relevant boards on the transmitters.  They are so sensitive that I could run my hands over a protective acrylic cover 30cms in front of them, not electrically connected at all and simply hanging on bolts attached to the same concrete wall, and that would upset readings.   It was one of those things I didn't explore much due to it being stable the rest of the time, but it was thought provoking!

Do you have access to a 4-20ma signal generator?  If none of the above works out, try a known amount via the generator into the PLC.

Aus

##### Share on other sites

Okay so as an update, the inputs now seem to be correct (I just took all the jumpers out and redid them, I think J3 was actually the issue cause it wasn't in its default state) but now the linearization is not giving me the numbers that I want it to.

The input numbers are within the range and aren't wavering at all, but the output is not what I would expect it to be. Also after the reset the big negative numbers did not go away.

Edit - Wait I lied ignore the negative number comment, I realize I didn't actually reset it. Those are now gone but everything else is the same.

##### Share on other sites

• MVP 2023

Are your linear blocks in a subroutine that's not being called?

Joe T.

• 2
##### Share on other sites

Of all the stupid issues, yup that was it. Everything is working now! Thank you guys so much for the assistance.

##### Share on other sites

5 hours ago, C_R_PLC said:

Of all the stupid issues, yup that was it. Everything is working now! Thank you guys so much for the assistance.

It's happened to me more than once in the early developmental stage of programming.  Make a subroutine and then forget to call it from the main routine. I've tried to force the habit of calling the subroutine first then builinding it

##### Share on other sites

• MVP 2023

This is a classic example of a quirk of Visilogic that REALLY annoys me.  It displays rungs as being live, even if the sub is not being called.  I have whinged about this before.  I repeat that if my old Win95 & DOS programs I've had for 20 years + for other PLCs can differentiate between active and uncalled subs over a 9600, 232 connection, something of Visi's maturity and current use should be able to do it easily.

Even though I love Unitronics, it is a really big failing in my view.

cheers,

Aus

##### Share on other sites

• MVP 2023

That's because (as I see it) VisiLogic is not really online with the PLC. All it is doing is looking at every operand and displaying its value onscreen in the VisiLogic program. Red lines are drawn through contacts and connectors (when the bit value would pass power) and red lines are drawn for the ladder rails. This is why you can go online with a completely different program than what's in the PLC and you won't know the difference on your PC screen (except for the logic inconsistencies). It's not a problem if you understand what's going on.

##### Share on other sites

• MVP 2023

What you say is true Flex, but I have PLC systems I built over 25 years ago still going and their programs and O/System DO differentiate between such things.  Other more recent models/makes do this as well.  If something made so long ago can do it, why can't the Creators implement it correctly?

1 hour ago, Flex727 said:

It's not a problem if you understand what's going on.

I respectfully disagree here.  Even though I do understand, I shouldn't need  to understand what is going on...the program should correctly display what is going on.  It's akin to being in a car with everything on the dash saying you're moving along nicely, engine ok etc. yet you look out the window and you're not moving!

1 hour ago, Flex727 said:

you can go online with a completely different program than what's in the PLC and you won't know the difference on your PC screen

In the past I have also asked for an automatic check of program name matching to counter this issue.  It has caught me out a few times.  I can't see that it would be too hard for online mode to first check if the program in the plc is the same name as the one that you are using.  With a user choice then available to proceed or not.

cheers,

Aus

## Create an account

Register a new account

×