LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to make that can take multiple inputs and we can choose one output as string?

Hello Folks,

 

I am designing a driver for one of the instrument in which i am giving a command to instrument and then reading the data from it and storing it in a file. 

 

I am stuck at a point because i don't know how to make visa write who can take multiple inputs one by one.

 

This is the case in which i want to give one command and then read all data from instrument and then give another command to stop the data acquisition. I want to start and stop data acquisition from the instrument in single vi and i need to feed it as an option to choose from whenever it's needed at the base of visa write. I have attached a vi with this. 

0 Kudos
Message 1 of 3
(2,712 Views)

I think you are close, but there some things I don't understand.

  • Is "get cfg" an entire command by itself, or does it require additional parameters that you take from "multi-line string"?
  • Do your command strings have a termination character or characters, like \r\n or \n?
  • When you send a command, does the Instrument return a single response, or does it keep sending back responses until you send it another command?

As you have configured it, this should send a string "get cfg" + whatever you specify in the multi-line string, but without any termination character.  It will then attempt to read, repeatedly, from the device until you push the Stop button (and if the device isn't continously pushing out data, you might get a timeout).  Finally, you don't close the VISA device, hence you might have trouble running the program a second time.

 

Suggestion -- put VISA resource name out and error out outside the While Loop, and wire the VISA reference to a VISA Close (and wire the Error Line through this function).

 

Bob Schor

0 Kudos
Message 2 of 3
(2,683 Views)

Hello Bob,

 

Thank you for the suggestions. 

 

  • Is "get cfg" an entire command by itself, or does it require additional parameters that you take from "multi-line string"? -

"get cfg" is the first command which is giving me and config file data line by line and i am storing it in data file. Now as some point when it's done, i want to give another command via trigger or some kind of input mechanism, so it will give me measured data and i can store it in same file/diff file.

  • Do your command strings have a termination character or characters, like \r\n or \n?

Command string does not have any termination character. 

 

  • When you send a command, does the Instrument return a single response, or does it keep sending back responses until you send it another command?

yes. when you send a command it sends a response. get cfg file gives me data of config file and then when i give "start" it takes the measurements and i am trying to read it through this vi. and store it in file. This instrument have mechanism to store that data file on board but i need to implement this so that we can read the data while it's running. 

 

I have implemented as you suggested,. so i m able to close the visa now. 

0 Kudos
Message 3 of 3
(2,650 Views)