LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA Resource Name conversion for Hex

I have a serial device that communicates only in Hex values.  In the checksum region it needs a value for the byte of the device address.  My device will be connected to different computers so the port number may be different each time.  Is there a way of using the "VISA resource name" to extract the port number and send just the port number to the HEX array i'm building for communication?

i.e. Have a front panel selector using the VISA I/O that keeps track of port number?

-Jesus
0 Kudos
Message 1 of 20
(2,898 Views)
You say 'device' but the device addressing is for RS-485 mode with multiple devices. I had a look at the manual and it does not mean the com port number. If you are using RS-485 and a multi-drop with individual instruments, there is no for you to determine that from the VISA resource name because that is only going to refer to Com1, Com2, etc. and these have nothing to do with the RS-485 address. For example, on com1 you might have units with address 2 and address 3.
0 Kudos
Message 2 of 20
(2,891 Views)
The serial communication is with RS-232.  And i'll have another device connected at the same time (RS-232 as well, already communicating with that device), which is why I wanted to be able to select which port it was connected to (also both equipment will be connected to another computer eventually).  The "VISA Resource Name" associates the COM value which is labeled on my connector, thus making it much easier to use the COM nomenclature, but since i'm communicating in HEX i need a numerical value (which i will input into my "Number to HEX string" to build array).  Visually it is easier to identify which COM i am using than to have to go through the device manager and figure out which Port is associated on computer.

-Jesus


0 Kudos
Message 3 of 20
(2,884 Views)

I think you are not reading the manual correctly. Everything I see says that address in hex only pertains to the RS-485 address. It is the address that is shown on page 24 of the manual and it explicitly says RS-485 only. On page B-2, the lead character for RS-232 is always CA and the Addr-LSB is always 01 for RS-232.

Now, if you need a programatic way to figure out which actual com port is connected to this and your other instrument, that is a different story but you do not have to change the hex value whether you have it connected to com1 or com99.

0 Kudos
Message 4 of 20
(2,879 Views)
You are right I'm not understanding my manual as you say but doesn't the Addr-msb need to change depending which port it is connected to?  I guess I'm asking will there be a conflict if i use the "VISA resource name" dialog with the Addr-msb?  Maybe just answered my question.

Thanks for your help.
0 Kudos
Message 5 of 20
(2,869 Views)
I checked the other thread on the RTE17 and noticed the library files that were written....

Can you point me towards what i need to add so that I can communicate with 2 different equipment on 2 different RS-232, one being the RTE 17 Bath using the aforementioned vi library files?

Thank you kindly, you have been very helpful.

-Jesus
0 Kudos
Message 6 of 20
(2,857 Views)

All you really need is two separate VISA Resources to communicate to two different devices. Use error in/error out connections tor control execution order.

This is a pretty generic question and without knowing a lot more about your requirements, it's hard to recomend a specific design pattern.

0 Kudos
Message 7 of 20
(2,848 Views)
I'm new to LabVIEW thus, maybe why i may sound more general than specific.  I'm thinking in the general sense to understand better, sorry.

So specifically could you give me advice on what I need to change in the library files found here:

http://zone.ni.com/devzone/cda/epd/p/id/4515

Just  for communication with the RTE 17? Forget the idea of 2 different hardware.  Do I need to add a VISA I/O?

Thanks,

-Jesus
0 Kudos
Message 8 of 20
(2,833 Views)


jesus.rp wrote:
I'm new to LabVIEW thus, maybe why i may sound more general than specific.  I'm thinking in the general sense to understand better, sorry.

So specifically could you give me advice on what I need to change in the library files found here:

http://zone.ni.com/devzone/cda/epd/p/id/4515

Just  for communication with the RTE 17? Forget the idea of 2 different hardware.  Do I need to add a VISA I/O?

Thanks,

-Jesus


I looked at the .llb file at that link.  I opened it in LV 8.5 and they appeared to be able to run (i.e., no broken run arrow).  What version of LV are you using?
 
In the top level VI RTE-17.vi, the port number was a hidden control on the front panel.  I have no idea why it was a hidden control.  It was originally saved in LV 6.1.  It had the following in its context help. (The spelling was not mine.)
 
When you use the serial port VIs under Windows, the port number parameter can have the following values:
0: COM1 5: COM6 10: LPT1
1: COM2  6: COM7 11: LPT2
2: COM3 7: COM8 12: LPT3
3: COM4 8: COM9 13: LPT4
4: COM5
On the Macintosh, port 0 is the modem, using the drivers .ain and .aout. Port 1 is the printer, using the drivers.bin and .bout. To get more ports on a Macintosh, you must install other boards, with the accompanying drivers.
On SunOS, the default mapping for port numbers is /dev/ttya, /dev/ttyb, and so on.
On Solaris, the default mapping for port numbers is /dev/cua/a, /dev/cua/b, and so on.
On HPUX, the default mapping for port numbers is /dev/tty00, /dev/tty01, and so on.  NOTE that these defaults work for HPUX 9.x but don't work for HPUX 10.x.  Use the serialDevices preference in your preferences file to adjust the names.  On HPUX 10.x the built-in serial ports are usually named /dev/tty0p0 and /dev/tty1p0.
On Cuncurrent, the default mapping for port numbers is /dev/console, /dev/tty1, /dev/tty2, and so on.
 
You can drill down through the sub-VI's to see how it used the Com port number.  It seems to be using some older serial port VI's where the value of zero was put into ASRL to give ASRL1::INSTR (after adding 1) which was coerced from a string into a VISA reference.
 
Just try using it.  If you have problems or errors, come back and post them.  Be sure to include any specific information such as the error number and message.
0 Kudos
Message 9 of 20
(2,826 Views)
I get back an error message:  1073807339 @ Serial Read error. 

I checked the serial connection with a loopback test which worked fine.  Also i tried the "show control" that was hidden and changed the port number as well but that resulted in same error.

-Jesus
0 Kudos
Message 10 of 20
(2,799 Views)