LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

virtual comport auto detect

Solved!
Go to solution

I'm not sure how to interpret "0-24": the hiphen should mean "from x to y" but while I understand how it works with single digits, I am a bit lost when dealing with two digits. Does it mean that it will find port 24 and 240 only? Will it find port 204?



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 11 of 39
(3,096 Views)

@Wolfgang wrote:

if you say so...

all I can tell is that viFindRsrc ( resource_manager_handle, "ASRL[0-9]*::?*INSTR", &find_handle, &return_count, instrument_descriptor ); does find all my serial ports, and I do have more than 30 Smiley Wink


Then you'll have to explain to the OP why it doesn't work for him.

 

 

0 Kudos
Message 12 of 39
(3,091 Views)

@RobertoBozzolo wrote:

I'm not sure how to interpret "0-24": the hiphen should mean "from x to y" but while I understand how it works with single digits, I am a bit lost when dealing with two digits. Does it mean that it will find port 24 and 240 only? Will it find port 204?


http://www.regexr.com/  is a very good website

0 Kudos
Message 13 of 39
(3,092 Views)

@nyc_(is_out_of_here) wrote:

Then you'll have to explain to the OP why it doesn't work for him.

ah why, my code is working fine Smiley Happy

 

Personally I think that the original post should provide some more details for better help, such as VISA version, a screen shot of MAX showing the serial port configuration (does he really have 255 serial ports?), the sample code and the respective return values for port 1 - 10...

0 Kudos
Message 14 of 39
(3,080 Views)

@RobertoBozzolo wrote:

I'm not sure how to interpret "0-24": the hiphen should mean "from x to y"


My understanding is different (but can be wrong, of course)

 

from the help: [list] :  Matches any one character from the enclosed list

 

To me 'any one character' means that it matches single characters, not numbers, so in my understanding 0-24 is interpreted as 0-2 and 4, i.e., 0, 1, 2, 4

[0-24]* thus should find both 24, 240, 204, but I do not have that many ports to verify Smiley Happy

At least it would explain your finding why ASRL[0-20]*::?*INSTR" fails to recognize port 4, in my understanding it will only search for port numbers 0, 1, 2, 10, 11, 12, 20, 21, 22, 100, 101, 102,...

 

I agree that a suitable example (in the documentation) would be useful.

0 Kudos
Message 15 of 39
(3,079 Views)

As far as I can understand I second your opinion_ 0-24 means "0 to 2 AND 4" so it detects port 4, 14 and 24 but not port 3, 24, 36...

 

It would be interesting to see MAX configuration in patil PC: if some port is not recognized there it won't be listed from viFindRsrc. Nevertheless he should be able to interactively create in nmAX the port(s) not listed, and see them in CVI after thet.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 16 of 39
(3,076 Views)

hi,

 

Thanks to all  for reply.

 

yes   i tried all d way  but  its  detecting only  upto o-9.

 

Please if any one have  valid woeking  code ,please share it . It helps me lot .

 

Thnak you .:)

0 Kudos
Message 17 of 39
(3,069 Views)
  1. Are ports >10 listed in MAX (MEasurement and Automation Explorer)? If not, can you try adding them manually? Then viFindRsrc should find them.
  2. You could try using the dll published by msaxon: it does not make use of VISA, just SDK calls

 



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 18 of 39
(3,058 Views)

HI

Thanks for reply .

Com 10 is showing in MAX (MEasurement and Automation Explorer), where i add/check list of  all port .

0 Kudos
Message 19 of 39
(3,055 Views)

hi

 

I still struggling in this issue, please give me proff solution .

i tryed all d way but its not working properly . please give me solution .

 

thanks

0 Kudos
Message 20 of 39
(2,989 Views)