LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PLC Modbus Labview Temperature Control Pulse (Increase and Decrease) setting

Hi Everyone.

 

I have a Unitronics PLC 430-TRA-J-22 manually measuring and controlling two temperature sensors. I have connected it to labview via modbus master and I am able to measure and increase the temperature on labview but failing to decrease it. I need someone to help me modify my pulse program to be able to decrease also if the False. For now if True, temperature increases but if I set it to decrease it doesn't, it only increases.

 

Please assist. I have attached a picture of my program and the actual program zipped.

 
 

 

 

0 Kudos
Message 1 of 2
(755 Views)

First I'd suggest you take some LabVIEW tutorials and learn about dataflow.

 

Here are the things I see wrong in order of simplest to fix to what is the real problem.

1.  If you take a screenshot, do it on the PC and save it as a PNG file.  Don't take an actual photograph of your monitor and post a 3 MB JPEG of it.

2.  Use block diagram cleanup.  Too many wires with unnecessary bends.

3.  Get rid of the array to cluster functions.  If you have an array, you use Index Array to get the various elements.  You expand the bottom of index array down to get multiple elements.  You don't even need constants on the indices because it will give you element 0, 1, 2, .... in order by default.  Array to Cluster is just silly and never needs to be used.

4.  In your top loop, you have a while loop inside of a while loop.  I really don't know why.  And you have a Stop button indicator. Why would you use a button control as an indicator if that loop stops.  That is just confusing.

5.  In your inner while loop, you are using "Set Bottom Temp" to tell how big of an array to initialize.  You then pass that array out, not clear what value it is, and onto your Modbus Write.  But you are only writing to 1 register, so I have no idea what is the point of an array of values that is as long as whatever "Bottom Temp" is.

6. In your inner while loop, you are ORing two boolean values together.  Again that makes no sense.  ORing numbers means a Bitwise OR of two numbers.  That can make sense for integers.  For floating points .....  I just have never seen a situation where that makes sense.

7.  You have a second while loop, but it is dependent on the first based on the boolean wire from the stop button going out.  I don't know for sure where that goes to.  I saw enough wrong in the picture that i wasn't going to open the zip file.  But I did anyway and saw it is just a single VI.  There is no need to zip up a single VI to attach it.  Just attach the VI and save us time and trouble.  Only use zip files if you have multiple VI's or a folder structure you need to maintain.

7B.  Once I opened the actual VI, I saw it was actually different from the picture you posted.  Why would you attach one picture that is completely different from the VI.  I was going to guess that the stop wire was going to the stop button in the 2nd loop, and thus the second loop, which wouldn't start until after the first one stopped, would only run once as a result because the wire is already True.  But the VI doesn't even have that, so I don't know what to comment.

8.  Throw way your VI.

9.  Sit down and write out a plan for your program.  Either a flow chart or some pseudocode so you can get the program logic thought out before you start laying down any wires.

10.  Only then do you start actually writing the VI.

0 Kudos
Message 2 of 2
(730 Views)