Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

sent a list of commands with RS232 Serial port

Hello, 

I start with my device "VACCU SELECT" to communicate with LabVIEW. To do this I use RS 232 Serial port with VISA.In the catalog I have all the necessary instructions to control and acquire continuously the pressure data.The connection is well made and the instrument responds very well, until the moment I have some questions to use these instructions.


1- do I have to send the commands instruction by instruction? and if I send a list of instructions in concatenated chain, does it work or not? I tried it, it responds and sends back all the answers but it is long.

 

the device answers a little long sometimes, and it is marked on the manual that it is necessary to put a wait of 100 ms between two successive instructions.
so my question is :
2- how can I send two successive instructions to the VISA with a wait of 100 ms.

Is the response of the device of the order of a few seconds (4s) tolerable, because it occupies of the regulation which is its principal mission. the problem here with what the moment or it makes the regulation it sends more answer as long as it is not finished the process?

 

I've been stuck for a week in my project as I work alone, I've searched everywhere but I haven't found answers to my questions nor detailed pdf courses for the control instrument part with visa and SCPI commands.
Someone could clarify things for me, I will put the user manual

 

Ayoubas01_0-1651584022222.png

 

 

0 Kudos
Message 1 of 3
(1,249 Views)

1. Move the VISA Open and the VISA Close to be outside of the loop.  No need to be constantly opening and closing the port.

 

2. Change your commands to an array of strings.  You can then use a FOR loop to iterate over the commands.  You will want to use the Stall Data Flow.vim to add a 100ms delay after each command.  It is not uncommon for instruments to need time to receive, process, and react to commands.  The manual recommends at least 100ms.  So I would go with that.

 

3. Four seconds sounds like a long time.  But it could be the instrument still playing catch-up.  Or it is accumulating more and more data points.  I would have to spend a lot more time than I have available going through the manual to understand this.

 

Thinking through this a little more, I think you are doing too much in the loop.  You only need to setup and start the acquisition once.  So you should open the port and then use the FOR loop mentioned in 2 above to do the setup.  Then you go into the While loop where you ask for the latest measurement and read the response for as long as you need.  After the loop, close the port.


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 2 of 3
(1,238 Views)

Hello ,  

Here is what I was able to do as a correction on my old program, it answered some of my questions but it remains for me:
1- it sends a set point less than the measurement on the instrument, but it does not send a higher set point
e.g.:
the measure has 500 mbar it can send 400 mbar but not 700 mbar?
NB: there is no problem on the instrument I have checked operation manually and it works very well! and it worked at the beginning with me on LabVIEW but now not;

2- it is always long to pass from one instruction to the other, even if I respect the time between two instructions which is 100 ms?

my goal is to send each time instructions in mbar and read in real time the pressure values, then stored on an Excel file, someone can see me with me this part please, I put you directly the application part Example of manufacturer's manual.

 

Best regards

 

Ayoubas01_0-1651653959464.png

 

 

Ayoubas01_0-1651652662918.png

Ayoubas01_1-1651652707122.png

 

 

 

0 Kudos
Message 3 of 3
(1,207 Views)