03-10-2019 07:38 PM - edited 03-10-2019 07:39 PM
To my knowledge I've never tried to treat it like a serial port. I have been able to communicate with the machine sending it individual commands through either a GPIB configurator I downloaded, VISA Test Panel in MAX, or this "Seminar Labview Code" I wrote. I have never been able to use the Agilent driver's to set the voltage etc. For whatever reason, it seems the drivers are recognizing it as a serial connection, instead of a GPIB. But all of my commands I have sent to my power supply using one of the three methods above all have been using GPIB commands (making sure to use Carriage Return/Line Feed ending (\r\n CR/LF)). I have sent GPIB only commands like *RST and *CLS and they work. So I am not sure how the the Agilent Labview Driver is recognizing it as a serial connection when I am able to select the same VISA Resource Name (COM 6) in my Seminar Labview Code and send GPIB commands and have it work.
03-10-2019 07:58 PM
Yes, I've seen this. I don't have access to a VISA device right now, but there's a trick to getting MAX to do this for you. I'll try to remind myself what and where this is (it might be something you set up in MAX's VISA Configuration). Oh, I think I remember -- you need to tell MAX that you are using a Termination Character (the same thing as the default setting for LabVIEW's Configure VISA function) and that the correct character is <LF>, 0x0A (or decimal 10).
You did the "right thing" by asking to read 1024 characters. With Termination enabled, it would read "Here is a string of characters\n", would see the termination character, and would return the string of 31 characters, but without Termination enabled, it keeps waiting for 1024 characters, then times out. Sorry, I forgot this (important) detail ...
Bob Schor
03-10-2019 08:26 PM
GPIB requires a particular type of plug, which is on the yellow thing plugged into your Instrument. It has (I think) 24 "wires" (connectors) that do various things. Depending on how the voltages vary on these 24 pins, communication occurs. The Yellow Thing also has a USB connector, and some "smarts" to read serial data transmitted via the USB port (which has far fewer than 24 wires, but works at much higher data frequencies than the GPIB end. The little box allows you to send GPIB commands using the VISA protocol -- don't worry what type of protocol is being used. [I've worked with devices that have both Ethernet connectors, RS-232, and USB -- once you've worked out how to communicate, you "talk" to it, regardless of the wire, with VISA ...].
Bob Schor