From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
10-31-2011 03:19 PM
Hello Everyone!
I need to write an application which could control an environmental chamber with TCP/IP, set Temperature and Humidity values and get response back from the chamber.
After carefully reading in the chamber's manual (Votsch VC 4018) my idea is to send an ASCII II string with my desired values of Temperature and Humidity and analyze the string I get back in response and display the values.
When I tested my code, everything went really well at first, I manage to connect to the chamber from a remote PC, I sent a string with my desired Temperature and Humidity values and got back a string from the chamber, showing the actual current Temperature and Humidity values which gradually approached to the desired values I sent.
BUT, after about 5 minutes of all going well, the response string from the chamber showed unexpected and unstable values, sudden "jumps" to extreme values (0 or 50) occurred, and sudden disappearance of the whole response string.
This pattern repeated itself every time I tested my code.
Any idea what might be the reason for all this? Could it be a timing and synchronization issue?
I'm still a beginner with labview and every help or a hint will be much appreciated.
Thanks again,
Shahar Levi
Hamburg, Germany
10-31-2011 03:47 PM
Hi Shahar,
you should consider changing your VI to a proper state machine design.
- You don't need 6 parallel loops to communicate with just one device...
- Usually it's bad design to use the STOP function (even more without timing order!)...
- You local variable "CliCabResponse" is prone to errors similar to RaceConditions due to your first clearing then writing new value. When using a state machine you don't need this local variable at all...
- When you're busy with refactoring: you don't need ReplaceChar when converting numbers to string, just use proper formatting codes like "%.;%4.f"...
10-31-2011 05:48 PM
Hi GerdW,
Thank you so much for your prompt reply.
- can I use state machine and still have different operations in parallel? Because I believe that in this Application I need to constantly send a string with desired loop to the chamber.
- Yep, I just took the STOP function out.
- I took out the part where I clear the local variable"CliCabResponse" but it still give me this pattern of unstable response string after few minutes of working well.
I still can't figure out what might cause this..
Greetings,
Shahar Levi,
Hamburg, Germany
11-01-2011 03:12 AM
Hi Shahar,
"can I use state machine and still have different operations in parallel?"
Well, there is only one data communication line between PC and chamber, so communication will never be in parallel. You also want to read answers of specific commands so you also don't rely on parallelism. Clear arguments for a state machine approach...
11-01-2011 01:57 PM
Thanks GerdW for your help,
I will try out that approach, hope it will solve my problem.
Shahar Levi
Hamburg, Germany
11-01-2017 03:33 AM
Hi Shahar,
I'm very interested in the vi that you have attached.
I'm missing however the subvi : ASCIItoTCP_IP.vi when i'm running the ConnectToClimateCabinet.vi.
Can you provide this SubVI also ?.
11-02-2017 01:09 AM
here you go!
11-02-2017 02:30 AM
Hi Shahar,
Super !! thank you...got a working vi now !!