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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Control an environmental chamber

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

0 Kudos
Message 1 of 8
(5,293 Views)

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"...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 8
(5,281 Views)

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

 

 

0 Kudos
Message 3 of 8
(5,269 Views)

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...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 8
(5,252 Views)

Thanks GerdW for your help,

I will try out that approach, hope it will solve my problem.

 

Shahar Levi

Hamburg, Germany

 

0 Kudos
Message 5 of 8
(5,231 Views)

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 ?. Smiley Happy

0 Kudos
Message 6 of 8
(4,276 Views)
0 Kudos
Message 7 of 8
(4,247 Views)

Hi Shahar,

Super !! thank you...got a working vi now !! Smiley Happy

0 Kudos
Message 8 of 8
(4,241 Views)