LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how can I select commad to read with Read VISA

Solved!
Go to solution

Hello,
I control a CVC3000 pump controller, with the RS232 protocol, I use VISA to send the set of commands. instruments responds well I still have a problem, that I send a list of instructions to execute, the Read VISA function, reads all the responses to the instructions, this causes me a problem in the display, I want to display only the pressure value on my indicator and not th sequence of responses to the various commands.
So my question is how can I display the measurement instruction and not the rest with Read VISA?
I explain I want to send for example this list of these command

 

Ayoubas01_0-1649405727160.png

OUT_MODE 2 return 2 in Read VISA and I'm not interested in that

Ayoubas01_2-1649405897458.png

IN_PV_S1 returns the value of my measurements and that what I want to display only on my indicator

Ayoubas01_1-1649405816688.png

 

Is it possible to exécute all these instructions and select which one I want to read and display at the same time otherwise I let you clarify the solution I put you my program attached thank you to all ?  how i can do this  

 

2-I have a second problem, my response to the instructions is a little slow, sometimes to send a pressure setpoint it takes the instrument about 4s to display the new value on its screen, and this means that I have to put a wait of (100ms exp) between writing and reading, as in the manufacturer's manual, I don't understand how to adapt this wait of 100ms between two successive instructions?
someone can give me an example I would be very grateful

Translated with www.DeepL.com/Translator (free version)

Ayoubas01_3-1649406257133.png

 

 

0 Kudos
Message 1 of 8
(1,766 Views)

I would put the commands in a case such that when you write a command your response can be captured and parsed appropriately. Also you can use a wait ms after each command to comply with the required timing. 

Note this code is an example of what you can do, it might not run as shown, it only conveys an idea. 

snip.png

 

______________________________________________________________
Have a pleasant day and be sure to learn Python for success and prosperity.
0 Kudos
Message 2 of 8
(1,721 Views)

thank you for taking the time to answer me, it seems to me that you did not understand my question well, I want to execute this set of commands and return that the reading of the command IN_PV_S1?
here in this case the problem is always the, Read VISA returns on the display (2 after the pressure and 0), and I want to have as reading on my indicator that the value of the pressure associated to Read VISA of the command IN_PV_S1, I hope I was clear as well

 

0 Kudos
Message 3 of 8
(1,697 Views)

Hi ayoubas,

 

you send all commands at once to your device, so I see two options:

1. What is the response string? Do you receive all responses at once? If so you"just" need to parse correctly...

2. Send the commands one after the other using a loop. Store/handle the responses as required!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 8
(1,691 Views)

the chain of response is :
the answers of the commands but not at the same time are separated by a very short time, for example:

2
360 mbar
0

I send this command at the same time.
Is it possible to return the answer only from the pressure associated to the command IN_PV_S1?

Can you illustrate me with an example?

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

I agree that I don't understand what you are trying to do but it sounds like you send one command and get back three separate responses. One way to handle this (if you know the size of the response in bytes ) is like this: 

snip.png

 

______________________________________________________________
Have a pleasant day and be sure to learn Python for success and prosperity.
0 Kudos
Message 6 of 8
(1,669 Views)
Solution
Accepted by topic author Ayoubas01

the solution that I made, it is exploited the existence of a string of characters that characterizes my answer wishes as all the measures have mbar and that the other answers that I do not want does not contain therefore with the function search once that it contains I display it in true and here is
thank you all for the effort.

 

Ayoubas01_0-1650028274774.png

 

0 Kudos
Message 7 of 8
(1,625 Views)

Hello,
My instrument responds to the instructions for a long time, it's a vacuum regulator, so is it normal to have a display shift on the instrument and labVIEW are not synchronized?
I would like to know where the problem is, is it that the instrument is doing its job which is the regulation and can't do both at the same time, or do I have to put a wait in the program of a few ms?
I saw on the datasheet that it is necessary to put 100ms between two successive instructions! but is it for the time to send on Write VISA, or for the reading.
I put you my program and I hope that somebody can help me thank you

programme.PNG

image002.jpg

 

0 Kudos
Message 8 of 8
(1,584 Views)