ā02-02-2010 08:19 AM
I am trying to force or remapping one of the COM port e.g. COM9 remap to COM3 by using Labview 8.5. Anyone have any idea how to write the VI to fo it rather then using XP window. Thanks
From Johnny
ā02-02-2010 11:50 AM
As far as I know that is a registry function, which are contained in LabVIEW, but are used with extreme peril (as is any "messing" with the registry). The functions are in the base package, and there are some examples. I did something like this a year ago, it is on another machine which isn't available at this moment. I try and look at it this evening when I'm in my hotel (I'm out of town this week). I don't think that I remapped the port assignments, don't remember, did have to change port settings normally accessable only in Device Manager, so I think it is applicable.
ā02-03-2010 03:44 AM
Thank you Putnam Monroe and I am really appreciated for your advice/help.
I am writting the vi production test and require to test many device with USB built in. I prefer to automate to remapping/force the COM port to allocate assign to the same COM port number by using labview, rather then using the Device Manager in XP window.
Problem: COM port number keep on changing every time I test plug in the same PC USB port with diffrent device/product. I know there is a way to configure the registry in the PC but I prefer to use Labview automate to force the COM port change/assign to COM port number as I have mention in my 1st forum. Thank you.
ā02-03-2010 07:58 AM
ā02-03-2010 09:34 AM
Some years ago I needed to make similar changes and made these changes in the visaconf.ini
There you find a section:
[ALIASES]
Alias0 = "'LPT1','ASRL10::INSTR'"
Alias1 = "'COM1','ASRL1::INSTR'"
Alias2 = "'COM2','ASRL2::INSTR'"
Alias3 = "'COM3','ASRL3::INSTR'"
Alias4 = "'COM4','ASRL4::INSTR'"
NumAliases = 5
[ASRL-RSRC-ALIAS]
Name0 = "ASRL10::INSTR"
Enabled0 = 1
Static0 = 1
SystemName0 = "LPT1"
BaudRate0 = 9600
DataBits0 = 8
Parity0 = 0
StopBits0 = 10
FlowCtrl0 = 0
Name1 = "ASRL1::INSTR"
Enabled1 = 1
Static1 = 1
SystemName1 = "COM1"
BaudRate1 = 9600
DataBits1 = 8
Parity1 = 0
StopBits1 = 10
FlowCtrl1 = 0
Name2 = "ASRL2::INSTR"
Enabled2 = 1
Static2 = 0
SystemName2 = "COM2"
BaudRate2 = 9600
DataBits2 = 8
Parity2 = 0
StopBits2 = 10
FlowCtrl2 = 0
Name3 = "ASRL3::INSTR"
Enabled3 = 1
Static3 = 0
SystemName3 = "COM3"
BaudRate3 = 9600
Parity3 = 0
StopBits3 = 10
DataBits3 = 8
FlowCtrl3 = 0
Name4 = "ASRL4::INSTR"
Enabled4 = 1
Static4 = 0
SystemName4 = "COM4"
BaudRate4 = 9600
Parity4 = 0
StopBits4 = 10
DataBits4 = 8
FlowCtrl4 = 0
NumOfResources = 5
I used the ini-file vis to do the changes. And keep in mind they are effective after a reboot then.
The visaconf.ini is now relocated in the documents and setting folder, and each user has a link to the all users file....
Back in the old days all processes where running as root š maybe the file access rights need to be changed.
Seems that there is a way with the MAX Copy Configuration.vi to do things like this.....
Maybe a NI VISA expert can throw more light on this??
ā02-03-2010 09:37 AM - edited ā02-03-2010 09:42 AM
johnny777 wrote:
Problem: COM port number keep on changing every time I test plug in the same PC USB port with diffrent device/product. I know there is a way to configure the registry in the PC but I prefer to use Labview automate to force the COM port change/assign to COM port number as I have mention in my 1st forum. Thank you.
If it is a FTDI USB chip device: I remember reading a KB article at ftdi.com about nailing the port number to a USB ID.... (don't know if profilic (?) or other USB slave chip MC have something similar, but I thought it's worth mentioning.
However this involves some changes in the USB driver settings š nice for your own PC but not for all customers ... but if you provide the driver maybe thats also a solution.
ā02-04-2010 08:18 AM
Thank you Henrik & Putna.
I have a look at the Windows reg function (see below diagram), I think it is posible to write to registry which will force COM port number alway the same e.g COM 7 every time plug in different USB. However, it is quite a complicate and very carefull when dealing with window registry.From Johnny777.