Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial Communication with multiple temp controllers

Hello,

 

     I’m trying to read the process value from 7 Omron E5CK temp controllers.  I’m new to LabView especially working with serial communication.  The VI.  I created does work but it’s horribly slow, I can only imagine that there is an easier way to read the values.  Basically I just copied the “Read Proccess Value VI” seven times and tossed in a waveform chart and a write to file.  Ideally I would like to take one sample of the values every 30 min. and write to an excel spread sheet.  I’m measuring values of multiple large water tanks that change temp very slowly so speed is not a concern I just want to create a reliable VI that can run for days at a time.  There has got to be a more efficient way of doing this.  Eventually I would like to expand to 14 controllers.  The Controllers can work with RS-232C and RS-485 communication.  Any help or tips on cleaning up my VI would be greatly appreciated. 

 

Thank you for your help.

Chad

 

Process Value 7 Controllers.jpg

0 Kudos
Message 1 of 29
(5,395 Views)
It makes no sense to have several parallel loops with all of that duplicate code. You have a single serial port so you can only communicate to one device at a time. Just create an array of commands and pass it into a for loop. Get rid of the evil dynamic data and the local variable. Do not use the delay function for anything more than a couple 100ms.

Where are you configuring the serial port? I don't see that in the image.
0 Kudos
Message 2 of 29
(5,360 Views)

I’m using this Initialize VI to set up my serial port before I run the VI   I posted earlier.  I would like to figure out a way of combining them into one VI but have not been able to get that to work yet.  Like I said this is all new to me so I’m still trying to learn all the steps.  When you say an Array of commands and pass them into a For Loop.  I’m using the same command and just changing the port number so just build an array with the seven commands I have listed and then where do I tie them into to?  I appreciate the help do you happen to have an example VI or something I could visually see what you are explaining.  I appreciate the help the help.

Thank you,

Chad

Initialize.jpg

0 Kudos
Message 3 of 29
(5,344 Views)

Is this somewhat along the lines that you were recommending?

Array.jpg

0 Kudos
Message 4 of 29
(5,339 Views)
That's not it at all. Place all of your existing code except the file write inside the for loop. You have to proceed and save the results from each instrument, correct? What you posted will only do one.

Please explain the purpose of the while loop.
0 Kudos
Message 5 of 29
(5,334 Views)

one extra remark about your initialize vi

You close the connection when you don't have an error.

In case of no error keep the connection, don't close it.

 

Furthermore why communicate in parallel, why not to every device after each other, a time frame of 30 min and normally you should get an answer within secnds.

greetings from the Netherlands
0 Kudos
Message 6 of 29
(5,329 Views)

Dennis,

  I don’t have a good explanation for the while loop except for the fact that it allowed the program to run that way.  I can place all my code in For Loop but than not sure how to wire the write to file outside of the loop.  Is the picture below any closer to what you had in mind?  Sorry for being such a novice but I guess I need to start somewhere. 

Albert,

  I have them wired in parallel because it was the only way I knew how to make it work.  I just need a way of recording the process value of each controller every 30 min to a spread sheet.  In my head it sounds simple to just take a snap shot of the temperature and write it to Excel but getting the code to work without using all of my systems resources I’m having trouble with.  I’m not looking for anything fast just a simple date and time stamp of each tank temperature.  Once I get the VI working I would like to take the Temp sample once every 4 to 6 hours threw out the day.

Thank you both for your help

Chad

Process Value 7 Controllers test 2.jpg

0 Kudos
Message 7 of 29
(5,324 Views)
Not close. Please take a few of the free LabVIEW tutorials. It should become clearer what I mean. You would have no duplicate code at all. Your first attempt was closer.

When a wire exits a for loop, it is by default an array. That gets wired to the Write to Spreadsheet.
0 Kudos
Message 8 of 29
(5,319 Views)

I don't have your subVIs, but you should be aiming for something like this.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 9 of 29
(5,295 Views)

Thank you Crossrulz,

  This helps a lot I will try to reconfigure my VI to look like your picture.  I imagine were you have the Address in I just put all my channels in some sort of array and feed them into the loops?

Thank you,

Chad

0 Kudos
Message 10 of 29
(5,276 Views)