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: 

NI VISA via Ethernet

Solved!
Go to solution

Hi All,

 

I would like to know information on payload data of Ethernet of NI VISA. Currently i am using NI VISA to communicate with device RIGOL DP832 via LAN. I am sending command *idn? to get description of device. I get required details but i am curious on how NI VISA ethernet packet works as i am creating my driver for this device.

 

I see payload length as 72 with special characters before command "*idn?" in payload data ASCII. with my driver command is of length 26(specified array length) and i see payload data as only "*idn?".

 

Could someone help me understand why i am getting this special characters in payload data of NI VISA?

0 Kudos
Message 1 of 13
(4,895 Views)

"NI-VISA Ethernet" is standard Ethernet accessed through VISA

 

Ethernet frame 

From Wikipedia, the free encyclopedia
A data packet on an Ethernet link is called an Ethernet packet, which transports an Ethernet frame as its payload.[1]

An Ethernet frame is preceded by a preamble and start frame delimiter (SFD), which are both part of the Ethernet packet at the physical layer. Each Ethernet frame starts with an Ethernet header, which contains destination and source MAC addresses as its first two fields. The middle section of the frame is payload data including any headers for other protocols (for example, Internet Protocol) carried in the frame. The frame ends with a frame check sequence (FCS), which is a 32-bit cyclic redundancy check used to detect any in-transit corruption of data.

 

But the beauty of VISA is you don't really need to know any of that, as VISA abstracts the communication bus specifics. So all you have to worry about is sending the (SCPI) commands to the instrument.  

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 2 of 13
(4,863 Views)

Thank you for your reply.

 

I know concept of ethernet packets and how frames are divided. But my question is command sent to device via VISA is different compare to command what i am sending via my driver.

 

In below picture you can see 1st two commands is from my driver and last one is from VISA. this is payload data in ASCII.

Payload_full.PNGPayload_VISA.PNGpayload_Canoe.PNG

Also if i compare data of VISA and my driver then i see difference in bits. I tried with 80 bit length but then i get all this special character after my command. I am still finding difficulty in figuring out why to payload frames of same command is different.

 

Thanks.

0 Kudos
Message 3 of 13
(4,855 Views)

Well at this point you are going to have to show us your code, otherwise we are just guessing.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 4 of 13
(4,851 Views)

I am using CAPL programming language and TCPsend command of CAPL after connecting to device.

program.PNG

Where DP832 is created socket through which i am sending my command to device.

0 Kudos
Message 5 of 13
(4,845 Views)

Is there any way to know how payload frames are constructed in VISA?

0 Kudos
Message 6 of 13
(4,832 Views)

Probably not without speaking directly to a NI engineer.  

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 7 of 13
(4,828 Views)

Offhand, I'd say someone was trying to send a CR/LF but mixed up hex with decimal values.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 8 of 13
(4,812 Views)

Carriage return or line feed has no influence on sending data frames i guess. My string sent as command converts data to hexadecimal. Could someone suggest or explain me how data is sent through NI VISA. As already mentioned before payload data sent via VISA is different. 

0 Kudos
Message 9 of 13
(4,780 Views)

What type of VISA resource are you using, INSTR (instrument) or SOCKET (raw socket)? If it's SOCKET, then VISA should be sending your string without any alterations. If it's INSTR, then the VXI-11 protocol will be used, which unfortunately I don't have any experience with.

Message 10 of 13
(4,768 Views)