06-17-2015 01:50 PM
Hello,
I have an instrument that is controlled by its own software on a PC that it is connected to with GPIB and RS232. I would like to write a labview program that emulates what the software does. I ran the GPIB analyzer during the initialization of the machine and captured this:
I want to send these 6 commands in LabView so I have a little vi that initializes the machine. I looked at this thread and tried to follow the advice given there. I need to send the string @?#yI followed by a line feed. I'm very new to LabView so I downloaded the example GPIB read/write and tried to make the changes suggested. Here is a screenshot of my attempt:
I'm sure this has many mistakes, can someone point them out to me? When I run it it either a) does nothing or b) gives me an error saying "the interface associated with this session is not the controller in charge".
Also, how can I send the "line feed" character? The manual for the instrument (attached, check page 63) says statements must be followed by a PRINT statement which is the line feed character according to the GPIB analyzer output ("a" in the sixth line).
Thanks!!!
Solved! Go to Solution.
06-17-2015 02:16 PM
06-30-2015 10:42 AM - edited 06-30-2015 10:44 AM
Thanks for the advice Dennis. This is what I ended up with:
The VISA read sends the 4 green commands (TA0, UNL, LA3, SC25) by itself and the "I\n" in the buffer sends the data.
Now I am trying to get information back from the instrument. This screenshot is what the software is doing (and I want to replicate). In the red square are the commands I want VISA read to send. The instrument sends "60." back.
Basically, I want to have listener address 0 (LA0), talker address 3 (TA3) and secondary address 13.
Here's what I tried:
You can ignore the stuff at the begining and see that for the VISA read I set the VISA resource name as GPIB::0::13::INSTR. However that created this result:
There is a big mess of green commands. I need LA0 and TA3. In this case I got LA0 but TA0 instead of TA3. This was the error I got when I ran it:
So then I tried using the same block diagram but with the address GPIB::0::13::INSTR for the VISA resource name input on the VISA read. This time this is what happened:
This time I got LA3 not LA0 and the TA was not set at all. This was the error when I ran it:
Do you have any ideas on how to get this to work properly and what I am doing wrong?
Thanks!
06-30-2015 11:00 AM
06-30-2015 12:58 PM
Sorry, it look like there's a typo in my post and I can't edit it. The first set of pictures is my attempt using GPIB::0::13::INSTR. The second is my attempt using GPIB::3::13::INSTR.
I now understand why I cannot read from address 0, but shouldn't it work if I read from address 3 (which is the instrument)? The 8 isn't for the address of the instrument, it actually specifies which function to use. Here's a screenshot from the manual:
So if you look at the case statement in the block diagram and the VISA write I send "DI" to secondary address 8 which means DC method and constant current.
Now I am trying to read from secondary address 13 and primary address 3.
As a side note, secondary address 13 is not listed in the manual... probably just poor documentation (manual is attached to my original post).
06-30-2015 01:51 PM
06-30-2015 02:15 PM - edited 06-30-2015 02:16 PM
Yep, the \ codes option is selected. The \n goes through fine and I can successfully do the VISA write, sending the data I want. Once I send it the system is supposed to send some data back and I can't get the VISA read to work to let me see that data. For example in the screenshot I posted the data sent back is the "60." under the red box.
06-30-2015 02:22 PM
07-01-2015 10:26 AM
Is that something I could use in LabView?
07-01-2015 11:20 AM