From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, 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: 

Sending Custom Commands/Queries

Solved!
Go to solution

I need help to send a query (command) to a Lakeshore 331 temp controller in order to read the the zone parameters. From the repsonse, I need to be able to use the numerical data in a function. My initial thought was to use the I/O assistant to send the ZONE? query, but I cannot get it to work properly. This is using a serial 232 connection. Any help is welcome. (I am very new to prgraming so a detailed explaination would be much appreciated). If you have a better idea than using the I/O assistant for this project, please let me know as well. I have been using the Lakeshore 331 Labview drivers but they do not have a zone read function included. The Lakeshore 331's manual is online and its I/O commands are listed in ch. 6 for serial.

 

Thank You,

 

Matt  

0 Kudos
Message 1 of 15
(2,936 Views)
It would be better for you to attach the manual instead of asking people here to do the searching.

I would not use the assistant. Just use the VISA functions as on the driver or serial examples. Please provide the command you are sending and any error codes/messages.
0 Kudos
Message 2 of 15
(2,930 Views)

Like I said, I don't know much about programming, so the command I have been sending is ZONE?. I got that from the manual ( http://www.lakeshore.com/Documents/331_Manual.pdf ) in 6-17. How would you recommend using the visa write/ read?

 

Thanks,

 

Matt

0 Kudos
Message 3 of 15
(2,903 Views)
Solution
Accepted by topic author MattEntner

Well if you read page 6-39 you'll see that the device is confused.  you haven't specified which loop or zone to query re-read section 6.3 "<Param> fields are required. so you need something more like "ZONE? 1,1[term]"

 

Some basics or VISA.  reads and writes allways take or return strings and only strings.  (It makes a lot of sense if you think about it)  Scan from string and format into string are on the string palletts (all sorts of string to number and number to string functions exist.)


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 15
(2,895 Views)

Would I actually write "[term]" or would I place something else there?

0 Kudos
Message 5 of 15
(2,892 Views)

The way I understand it is, "ZONE? 1,3[term]." Is there a way to turn the 3 into a variable so that it can be chosen through the UI (or for the computer to automatically cycle through and read every zone and turn it into an array)? I don't want the user to have to change the entire command each time a different zone needs to be read . 

0 Kudos
Message 6 of 15
(2,887 Views)
You can use the Format Into String function inside s for loop.

You need to take the basic tutorials.
0 Kudos
Message 7 of 15
(2,879 Views)

I do not believe that a for loop is going to be able to change a single value inside of a string in the scenario that I had imagined. I am using a for loop to cycle through a csv read, but if I am sending a command (in the form of a string through a VISA write) a single value in the text will not change simply by a for loop when the entire command would have to be in the for loop. I was wandering if there was a way to write something like ZONE? 1,X[term] Where X could be a local variable inside of a for loop to cycle with an increment by 1 function.   

0 Kudos
Message 8 of 15
(2,871 Views)
Of course a loop will work. The zone numbers would be an array of numerics that is passed to the Format Into String and the string is passed to the VISA Write. The output of the for loop is an array. This is basic stuff and it why you need the free tutorials/classes.
0 Kudos
Message 9 of 15
(2,863 Views)
If the zone numbers are always continuous, you could wire to the iteration count terminal with the increment function.

Using a local variable would be very bad style.
0 Kudos
Message 10 of 15
(2,860 Views)