Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

rs-232 my application is sending a command on com1 when I have change to com2 with a controller

Hello!
 
I need some help getting my application to work.  My application is for controlling a camera connected to the com port, but I want to controll different cameras on different com ports. So what I did was to change from Constant to Controller on the Visa Configuration.  And it works on the different com ports, but when I change com port, it send a command to the previous com port.  WHY??? and how can I change it???
 
Please Help!!!
0 Kudos
Message 1 of 4
(3,397 Views)

First of all, it's impolite to post a VI that you can't stop!Smiley Mad With the stop button hidden and not in an event case, how do you stop it? Make the stop control visible and create a Value Change event for the stop button instead of wiring it outside the event structure.

Second, your posted VI has the VISA Resource Name as a constant and not as a control so there is no way to change this when the VI runs. If you want the ability to change com ports, change the constant to a control and create a value change event for that. Close the existing resource in there and initialize the new port. Pass the new VISA Resource from event to event with a shift register. The attached should work a little better.

0 Kudos
Message 2 of 4
(3,394 Views)
Thanks a lot Dennis!!! it works very well...and sorry for posting a program that didn't run.. I posted a testing program...instead of one that worked. Well anyways now I just have one small problem. I'm wondering if it's possible to change the text of com1, com2 and so on....plus to remove the LPT1 and com 0 from the dropdown list???
0 Kudos
Message 3 of 4
(3,362 Views)
Change the text how? Com1, Com2, etc. are aliases and you can change them to whatever you want to in MAX. I also know that there is some name filtering available with LabVIEW 8.2 and the latest version of VISA but I haven't tried any of this yet. To do it in older versions ov LabVIEW, you can use VISA Find Resource and populate a text ring with the results. For example, if you use 'ASRL[1-9]::?*INSTR' as the expression and 2 as the search mode, that should eliminate the lpt listings which usally have an actual VISA resource name of ASRL10::INSTR.
0 Kudos
Message 4 of 4
(3,351 Views)