Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

tcpip using niMAX

Solved!
Go to solution

hi

 

i am using the Ni MAX software. i used it to find a device on the network via ethernet. my issue i am trying to send a command from MAX, the instructions are as follows <esc><password><esc><action><cr>, now im stuck on the "esc" character the following is from the instructions for the product
 

ASCII Escape character. 001b hex or 27 decimal., the password is PASS and the action is n, and the cr is \r

 

so do i type #H1B PASS #H1B n \n, they showed me an example of \ePASS\en\n but that did not work.

 

i used a online converter and that converted 27 to 1B.

0 Kudos
Message 1 of 13
(5,430 Views)
If you are using '\' Codes, then you need to send \1B. Don't know why you would want to send \n when you have already stated you need \r.
0 Kudos
Message 2 of 13
(5,420 Views)

hi, i tryed \1BPASS\1Bf\r it did not work, i also tryed \x1BPASS\x1Bf\n that did not work either, again i'm using niMAX via ethernet. i also tryed
\'PASS\'f\n that did not work either,

 

 

 

this is from the manual

 

All of iBoot's commands follow the following format:

<esc><password><esc><action><cr>

<esc> ASCII Escape character. 001b hex or 27 decimal

<password> The 1 to 10 character Power Control (not Setup Password). The default password is

PASS. The password is case sensitive.

<action> The following actions are valid for iBoot. These actions are case sensitive:

n Turn Power ON

f Turn Power OFF

c Cycle Power. Cycle time is determined by Setup

q Query.

<cr> ASCII Carriage Return character. 000d hex or 13 decimal ( /r )

0 Kudos
Message 3 of 13
(5,416 Views)

Don't know since I do not have the instrument. Using \x1B is certainly wrong.

 

For some reason, the VISA interactive commands do not show up in NI-Spy though I really don't know what tool you are using in MAX. Try writing a small app and run it with NI-Spy on. See exactly what you are sending.

0 Kudos
Message 4 of 13
(5,411 Views)
The only reason NI-VISA API calls made from NIVisaic (or the test panels in MAX) wouldn't show up in NI Spy is if the option to log VISA API calls is deselected. To make sure any NI-VISA calls made from any program is logged in NI Spy, please select Spy>>Options... from the NI Spy menu and go to View Selection tab. On the left half of that tab, you should see a list of Installed API Choices. If you check NI-VISA in that list, then you should see all NI-VISA calls logged, no matter where they are made from.
0 Kudos
Message 5 of 13
(5,408 Views)

I had the option set when I first tried it. Just tried it again and it's working.

 

It seems that the '\' in the interactive control works much differently than what I am used to in LabVIEW. If I use \1B in MAX, it does not send the escape character. It sends a 1 and the character 'B'. I have no idea if this is something that can be changed or if it's even possible in MAX.

0 Kudos
Message 6 of 13
(5,393 Views)
hi if 13decimal becomes \r, then 27decimal becomes a \e?? \ePASS\ef\n i tried this and this didnot work either.
0 Kudos
Message 7 of 13
(5,356 Views)
And what happens when you use your programming language?
0 Kudos
Message 8 of 13
(5,341 Views)

hi, i am using the Ni measurment and automation explorer-devices and interfaces-via TCP/ip resources-validate(sucessfully)-open visa test panel-click on ViWrite tab>>>

 

i have two devices connected to the tcp/ip the first device i can send commands via tcp/ip visa test panel(Viwrite tab), but the second device is different that it requires

<esc> ASCII Escape character. 001b hex or 27 decimal

 

 

the esc character is where i am stuck. i don't know what goes there i have tried \e,\n,\x1B, X'0000001b'. i have spoke with the company and they said when they use pearl it is \e, so i guess when i use visa or vi-write it should be.......    

0 Kudos
Message 9 of 13
(5,318 Views)

You have already said that you are using MAX and I fully understand it's utility as a testing program but obviously you will not be using it long term and eventually you will be using some other programming language. All that I am saying is try the communication in your programing language. I know that in LabVIEW, it took e a minute to write a VISA Write program with \1B and confirmed that is working just fine. 

 

\e may work for perl but it is not  working with MAX as you can see with NI-Spy. Frankly, I don't know if you can send any escape characters in MAX except for \r or \n. That is why I keep asking if you have tried it with your programming language.

0 Kudos
Message 10 of 13
(5,310 Views)