LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

virtual comport auto detect

Solved!
Go to solution

1)   Again i am confuse . my aplliction is  read which comport is connected  and  config that  comport  and  do communictaion . 

      AS per your  code its detecting  all comport right .  In my appliction  connecting only one comport  and never use  more 2  comport at a time  . 

     if i  am  using only one comport  then no need  to " viFindNext".

 

     eg.   if my comport is  bleow port no 9.  if use viFindNext its shows  port no 10 only .

    and if my comport  no is ablove 9  .  1st time its  read  com port no 10  and then its read actual  connected  port no. 

 

 

2) can you give soltuion  for my appliction:

    I am using labwinodw v 13 .

(USING ONLY ONE COMPORT AT A TIME )

     In my appliction just find which comport is conected  and config that one ( In my appliction the comport no is variey w.r.t my  test baord , it may 3 to 50 )  and  send some command  uisng that comport . 

 

0 Kudos
Message 31 of 39
(2,731 Views)

And some questions to answer:

 

please see  bleow ans:

 

- Are you using VISA to communicate also or only to detect the ports in the system?

 >>> yes i am using VISA to communicate .

- Which function is returning that -1 error?

>> if its  detect more than 10 port  VISA  showing rs232 error -5;

- Did you make a try with msaxon code?

>> Not yet . , is this only add taht  code  or  need to copy dll file somewhere in my pc .

- Which ports are returned on the first pne and which one on the second? Do they actually exist in your system?

>> no  in sytem exist only one comport .  if the comport below  com10  VISA detecting  correct  comport  as it in Device manager ,  if  comport no is more than com9  visa always detecting  comport no 10 . 

 

 

0 Kudos
Message 32 of 39
(2,727 Views)

Not knowing the hardware is difficult for me to understand the situation. Let me comment some sentence.

 

In my appliction  connecting only one comport  and never use  more 2  comport at a time.  if i  am  using only one comport  then no need  to " viFindNext".

This is not true: the key point isn't how many ports are you using, but how many ports are in the system. You cannot ignore you have a port 10: whether is a parallel port or a fake port or something else, it actually is in the system and will be returned by searches!

 

Question: are we speaking about hardware ports in the system or USB-to-serial converters that can assume different port numbers every time they are connected? If the second: are they connected after or before the application is started?

 

And you have not answered to my previous questions which I list here again:

Question: Are you using VISA to communicate also or only to detect the ports in the system?

Question: Which function is returning that -1 error?

Question: Did you make a try with msaxon code?

 



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 33 of 39
(2,726 Views)

hi

 

Question:

are we speaking about hardware ports in the system or USB-to-serial converters that can assume different port numbers every time they are connected?

yes using  vertual comport ..  serial to usb convertor 

If the second: are they connected after or before the application is started?

connecting befor appliction starts 

0 Kudos
Message 34 of 39
(2,721 Views)

Which version of VISA have you installed? Did you looked at Wolfgang note regarding the error in VISA <15?

Upgrading the system may solve your problems. The latest version of VISA can be downloaded from here



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 35 of 39
(2,711 Views)

Actually it is not required to install a new VISA version, all the problems can be solved by two mouse clicks... it would, however, require reading the post I have linked before Smiley Wink - actually it is just the screenshot provided by JB

 

Given that the software always runs on the same computer with one internal serial and LPT port and one additional, external serial port one can use MAX to disable the two static motherboard ports by removing the check mark of the respective port, then VISA will not find ASRL10 and ASRL20 any more... and viFindRsrc will only find the external port (provided that the search string is corrected) Smiley Happy

 

In my opinion not the best solution (not portable), but definitely the fastest.

0 Kudos
Message 36 of 39
(2,703 Views)

HI

 

But my issue is  not only 10 and 20 port.  IN VISA  more than 9 port is not deteting (finding )[status = viFindRsrc (defaultRM, "ASRL[0-9]*::?*INSTR", &find_list, &retCnt, instrDesc);  Above  9 port number  visa  showing only  like  "ASRL10::INSTR"

0 Kudos
Message 37 of 39
(2,700 Views)
Solution
Accepted by topic author patil1983

It doesn't find the port or are you looking for the first port found only?

If the port installs as #11 and you already have port #10, viFindRsrc will show port 10, viFindNext will show port #11.



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 38 of 39
(2,689 Views)
Solution
Accepted by topic author patil1983

Thanks for your  support  and valueable reply .

0 Kudos
Message 39 of 39
(2,650 Views)