LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial Read w/ Timeout

Pre-Labview 6 had a Serial Read w/ Timeout vi where you could simply wire the port number (eg. Com1=0, Com2=1, etc.), but in LV 6 it now has a Resource Node. Is there anyway to simply wire a port number to this vi?
Thanks!
~j5


2006 Ultimate LabVIEW G-eek.

0 Kudos
Message 1 of 9
(3,509 Views)
Jonnie,
You can still use your old code and the new serial vi's. I have attached a vi showing this. You need to have the visa drivers installed for this to work. Use a visa find to get a string array, index the array for the com port you want. Then use a type cast to convert the string to a resource.
Hope this helps,
Ben
Message 2 of 9
(3,509 Views)
Wicked cool!
Thanks


2006 Ultimate LabVIEW G-eek.

0 Kudos
Message 3 of 9
(3,509 Views)
No Problem, glad it worked. If you wanted to be really creative you could have that sting populate a ring control and use that to index the array. That way what ever system you put the vi on to run you could scan for ports and your ring control would only have the ports listed for that machine. This is what I have used for multi system deployment. I changed the fist vi to show this.
Ben
0 Kudos
Message 4 of 9
(3,509 Views)
The VISA Resource Name control itself shows all of the ports without doing any extra code. Just click on the arrow, view them and pick the one you want.
0 Kudos
Message 5 of 9
(3,509 Views)
How do you get the names to change from ASRL to something like com1 or com2? I would have used the original resource control on my software, but I had to distribute it out and there was a lot of cunfussion on the user part as to waht ASRL meant. Is there a way to change the resource control naming?
0 Kudos
Message 6 of 9
(3,509 Views)
Agreed, that's why I asked in the first place. So, what does ASRL1::INSTR mean and how does it relate to Com1, Com2, LPT1, etc?


2006 Ultimate LabVIEW G-eek.

0 Kudos
Message 7 of 9
(3,509 Views)
Com1, Com2, etc. are aliases for ASRL1::INSTR. Noramlly, when a full installation of NI-VISA and MAX is done, the alias creation is automatically done. When run-time VISA is the only thing installed, you don't have the aliases but you could include as part of the installation, a file that contains the aliases. Look on your development system for VXIpnp\WinNT\NIVisa\visaconf.ini. You should see a couple of alias sections. I also seem to remember an example program that did a modification of an existing file. You might try a search of the forum to see if you can find any references to visaconf.ini.
0 Kudos
Message 8 of 9
(3,509 Views)
Thanks, I will do that.
0 Kudos
Message 9 of 9
(3,509 Views)