LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ansi escape sequence

Hi ,

It's my first post here and i'm quite new in Labview. and please forgive my english, i'm still learning.
I tried to communicate using serial port. The problem is, whenever i send something like CR, the mechine respond the way it supposed to except 1 thing, it send an escape code sequence (supposed to be a cursor) with it. I tried using hyperterminal and it work fine.

my question
1 - can labview somehow decode the escape code sequence? if yes, how?
example : [2;1H IND SET REF TEST
correct display : IND SET REF TEST

Thanks in advance.


0 Kudos
Message 1 of 8
(5,430 Views)

It would appear that the device you're trying to communicate with is doing something like VT100 terminal emultation. If you were to set Hyperterminal for regular ANSI instead of Auto Detect (or whatever), you would probably see the same thing. Doing full terminal emulation in LabVIEW is non-trivial. The VT100 spec contains a lot of escape characters that you would need to trap and then modify the received data. In your case, you would have to capture the string before it's displayed (i.e. with Scan String for Tokens), detect the escape code, determine which part of the data the code applies to, strip the escape code that from the text, write the data to the string indicator, then using property nodes (Text.SelStart, Text.SelEnd, Text.FontUnder) modify the text to get the underline. If that's all that you have to do, then it won't be to bad but if it's a full VT100 emulation, then there are also escape codes that determine row and column for data display, blinking, etc. If one the other hand, all you need to do is determine which text is underlined (presumably to determine which menu choice is active, you could simply strip the escape characters from the display and then take the next action based on which section of text the escape character precedes. So, for example, IND was the menu item active and you needed to get to the TEST menu, write three tab characters and a CR/LF.

I had a similar problem with testing a product that only had a VT100 interface. Instead of doing a LabVIEW implementaion, I bought a program called HyperAccess. Written by the same people as HyperAccess, it had VT100 emulation and a full set of ActiveX methods and properties so I used those instead of VISA.

Good luck
0 Kudos
Message 2 of 8
(5,413 Views)
Dennis,
  Can you go into a little more detail on how you implemented hyperaccess to communicate with labview.  I have a real stubborn piece of equipment that needs to see a lot of the vt100 emaultion replies in order to communicate.  It sound like you have nailed this previously with the hyperaccess implementation you wrote about.

0 Kudos
Message 3 of 8
(5,312 Views)
The only problem I had was in creating the HyperAccess objects within LabVIEW. I don't remember the exact details. I had the help of C++ programmer and he created a DLL that returned a reference to the script object. It's the script object that has all of the methods you need for automation such as opening a terminal session, sending keystrokes, getting data from a line or field, etc. I use TestStand and call the DLL to create the object reference. From that, the VIs just use an Invoke Node. One method I use a lot is GetTextFromScreen. You specify row, column, and number of characters to read. Another method is TypeKey. You pass it the key (i.e. ESC) you want. There's hundreds of methods and most are not specific to VT100. It's just that the HyperAccess program formats the screen correctly and you don't have to parse through all of the control codes that are part of VT100 to actually get the information. The downside to this approach is that the HyperAccess program is always running and test operators can (and have) closed the window. If you want the DLL, I think I can send it but I'll have to check first.
0 Kudos
Message 4 of 8
(5,307 Views)

Dennis, can u post that DLL with an example.

I actually want to bring the functionality of HyperAccess using ActiveX control in my Labview application. 

By just using HyperAccess or Hyperterminal on VT100 or VT102 emulation, it works fine with other device. In hyperterminal or hyperaccess, same screen is continously displaying data received from other device along with commands typed and sent through the same screen. I want to bring same thing in my Labview application. So if u could help in this regard?

0 Kudos
Message 5 of 8
(5,201 Views)
Let me see what I can do. As I said, I had the help of a c programmer and I'm using the DLL in TestStand to create the object and then pass that to my LabVIEW program. I don't think the dll will work in LabVIEW alone.
0 Kudos
Message 6 of 8
(5,194 Views)
Thanks Dennis, I am waiting .\
By the way DLLs can be used in Labview using CALL LIBRARY FUNCTION NODE.
0 Kudos
Message 7 of 8
(5,185 Views)
I'm well aware of that. The problem is that the DLL was written to get a TestStand reference and then write the HyperAccess objects to TesStand variables.
0 Kudos
Message 8 of 8
(5,180 Views)