Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Reverse Engineering Portmon log to obtain Labview serial configuration settings

Hi there,

I am attempting to interface Labview with a custom-designed power supply device through a USB-RS232 adapter. The power supply came with a "debugging interface" programmed in java with which one can send and recieve commands to the board (detect, set voltage, get voltage, stop, reset, etc.) through the USB-RS232 adapter which works fine.


I however am not experienced with java in the least and want to streamline command sequences with Labview, as I am interfacing the rest of my lab equipment with Labview. I dont have experience connecting serial devices, I do have USBTMC & GPIB VISA interfaces with the other equipment.

Nonethless I've tried the advanced serial communication example provided by NI, (http://www.ni.com/example/27665/en/) - I have appropriately set to COM3 as my device manager (and MAX) find the correct port for the device, baud rate, data bits, stop bits, parity, flow control, XON/XOFF characters, Input Buffer Size, End read/write with termination character, which termination character, and how long till time out.

Yet from my Portmon log, I'm seeing that the java interface sets a few other parameters that I (at the moment) do not have access to through the labview VI (or from MAX). How do I set Output Buffer Size? What are  EOF? EVT? Replace? XON/OFF limits? WC? How do I set them?

Both Portmon log files are attached.

Download All
0 Kudos
Message 1 of 7
(5,726 Views)

Output Buffer Size - This is set with the VISA Set I/O Buffer Size VI that is in the example you were looking at. The documentation says it is just the Input buffer size but it is actually the I/O buffer size.

 

This forum post answers your question about XON/OFF Limits:

 

http://forums.ni.com/t5/LabVIEW/Can-I-set-XonLimit-and-XoffLimit-for-serial-port-communication/td-p/...

 

I am not sure yet about the other commands you have asked about. Have you looked around in the VISA Serial property node options? Have you made any progress?

Applications Engineer
National Instruments
0 Kudos
Message 2 of 7
(5,692 Views)

Hi Holly,

Yes, thank you! I thew on a second I/O Buffer size node and set the output size to 1024, so I now have correct input AND output buffer sizes.


In the thread you linked a couple replies say "Xonlimit/Xofflimit is only used with flow control on" and "You want to set XON/XOFF parameters, but you want flow control off? Then what's the point?" and I have flow control off, so I suppose these limits, or even values for XON/XOFF do not matter for me...

Still no idea what WC, EOF, EVT, Replace are and how to set them:
Java's WC = 0 vs Labview's WC = 500

Java's EOF = 4 vs Labview's EOF = 0 
Java's EVT = a vs Labview's EVT = 0
Java's Replace = a vs Labview's Replace = 40


The VISA Serial Property node does not appear to have control for any of these values...

0 Kudos
Message 3 of 7
(5,688 Views)

I did find the "Replace Character" Property in the Instr node.

 


Edit: Actually this setting changes ERR & BRK to whatever number, not "Replace"

 

And I made a mistake in the post above, Java's replace value is = 0

 

0 Kudos
Message 4 of 7
(5,682 Views)

Update:

 

from
http://msdn.microsoft.com/en-us/library/aa450503.aspx
It appears that

EVT = value of character used to end data

EOF = value of character used to signal an event


I'm thinking that these must correspond to Inst node's properties:

EVT - ASRL End In (end mode for reads)

&

EOF - ASRL End Out (end mode for writes)

although I've tried to set them to all allowable values (None, last bit, terminal character) and see no change to the program, still timing out when i send *IDN?

 

Nothing that resembles WC


0 Kudos
Message 5 of 7
(5,669 Views)
I think you are over thinking these minor serial settings. Just ignore them. You should only need the settings provided by the VISA Configure Serial Port with the possible exception of setting the termination character on a write. Please post an image of your code and the instrument manual. Since you are sending idn, I'm hoping that you found that query in the manual.
0 Kudos
Message 6 of 7
(5,659 Views)

OK!! Problem solved! Dennis, you were right, I was overthinking it with these other parameters.

The board was waiting for a beginning of text character for every write command (hex 02), now that I look at the java programs .log file it seems fairly obvious.

Threw that character onto the beginning of every input string and now everything is working!

Thanks!

0 Kudos
Message 7 of 7
(5,637 Views)