I’m a newbie in LV and to practice I’m controlling a power supply (TTI) with labview. Requirements are really easy. All I have to do is creating the first channel of the supply. There’ll be three main buttons SET, OUTPUT and STOP. SET button will set the voltage and current values that the user wrote; OUTPUT button will open the OUTPUT of the channel 1 and STOP button will stop the code and close the power. The communication through supply and LV will be over TCP protocol.
I’ve decided to use Queued message handler and created two different loops, the event handling loop and the message handling loop. For event handling loop, I’ve created an event structure for the three buttons that I’ve mentioned above. I think I’ve handled this part pretty good however for the message handling loop I’ve some problems. I’ve created a case structure and cases are here:
-
Init -> I’ll be initializing variables and it’ll lead to the open connection case
-
Open Connection -> In this case I’m opening the TCP connection, also created a constant to store the ID
-
Set Values -> I have to send the set value command that I’ve created in the event handling loop
-
Output -> I have to open the output channel of the power supply
-
Measure/Display -> I have to show the current Voltage and current values of the supply, it has ta be done in every 200 ms
-
Stop -> I have to stop the program and close the output of the supply, also release the queue
The problem that I have is that I can’t figure out how to combine these cases with TCP, I’ve done the Init and Open Connection parts and a little bit of Set Values, however I don’t know how my approach should be.
-
How am I supposed to measure and display the current values in every 200 ms with TCP?
-
How can I parse the response of the commands that I sent over TCP?
Please don’t forget that I’m a newbie and there’re too many things that I don’t know.
Aldocest is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.