LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I send an Escape code with the instrument assistant?

I have a RCL meter attached to COM1 and trying to use the DAQ instrument assistant.  Some of the commands require the ASCII escape character followed by a number.  Commands that are simple text work fine, but attempts to send the escape character (hex 1b) do not.  I tried \1B1 to try to send "ESC 1" (with no space), but nothing happens.
0 Kudos
Message 1 of 9
(2,662 Views)
Hi Tim
have you tried using MAX instead ?

chow
 xseadog
Message 2 of 9
(2,661 Views)

Thank you for the reply, I have not tried MAX, but will look into it.

FYI, I can send an escape string using VISA write, but the DAQ instrument I/O assistant looks like it is the quick way to create an application for talking to an instrument.

Tim

0 Kudos
Message 3 of 9
(2,657 Views)
The Instrument I/O Assistant is a quick way to do an instrument session and \1B is correct as you've found out with the VISA Write. I've never used the assistant for any real work as I prefer to create a driver so I don't know if the assistant has a problem in translating '\' codes. You can right click on the assistant and select Opne Fron Panel. This creates a normal VI and you can look at the generated code to see if it's correct.
Message 4 of 9
(2,637 Views)
Unfortunately, this is not possible in the current Instrument I/O Assistant.  It should be possible in future versions of the Assistant to send binary values.

-Tommy
Message 5 of 9
(2,629 Views)
Thank you all.  As Dennis K. suspected, the underlying code for the DAQ I/O assistant does not support "\" codes.  I did write my own simple vi from scratch and it works okay.   I looked into MAX a little, but really don't know how to apply it.  MAX has a lot for GPIB, but not much (that I saw in my brief look) for RS232 instruments.
Thanks again everyone.
Tim C
0 Kudos
Message 6 of 9
(2,615 Views)
Tim -

It sounds like you were able to get things working from scratch, so this may not matter...

You mentioned the code generated by the Instrument I/O Assistant does not support '\' codes - well, the underlying code is just LabVIEW code, which does support '\' codes.  If you right click on the string constant that contains your command that is passed into the VISA Write, you can select "'\' codes display" from the menu and then you can use '\' codes in your command string.  Is this what you were looking for in the generated code?  LabVIEW does support using '\' codes, it is just that the current Instrument I/O Assistant does not.

-Tommy


Message 7 of 9
(2,605 Views)

Hello Tommy,

Thanks for your review.  You are absolutely correct, the underlying vi can be edited to support "\" codes.  When I said the underlying code for the DAQ I/O assistant does not support "\" codes, I meant to say it does not have the "\" codes enabled.  My limited understanding of express vi's is that once edited, it is no longer an express vi.  I have yet to try making my own express vi.  Is it simply making the edit and recompiling (if that is the term) to achieve a custom express vi?

Thanks again.

Tim C

0 Kudos
Message 8 of 9
(2,598 Views)
Tim - your understanding of Express VIs is correct - once you edit, or even view the underlying code of an Express VI, you no longer get the configuration wizard, you just get a plain VI.  It is not possible to edit the VI code, and then get the Express VI back but you can take the code given by the Instrument I/O Assistant and build off of it instead of starting from scratch.

NI offers a toolkit for creating your own Express VIs, but this is not the solution you are looking for.

-Tommy
0 Kudos
Message 9 of 9
(2,583 Views)