LabVIEW APIs Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Can you change a VISA Reference control's VISA class using scripting?

I need to change the VISA class of VISA Reference controls on dozens of VIs from "I/O Session -> Instr" to "I/O Session -> Serial Instr". I was hoping to build a scripting tool to do it, but don't see this property exposed by LV Scripting. Anyone know where I can find it, or can confirm it's not available? I see the Undo system can reverse changes to this (referring to it as "Undo Change Attribute"), so I suspect it's out there, just not obviously so.

 

Thanks,

Erik

0 Kudos
Message 1 of 5
(2,086 Views)

I'm not superfamiliar with how VISA refs work, but in the palettes aren't they all separate controls? So instead of changing an attribute, maybe you should be looking at replacing the control with the correct one?

 

Just a thought

Sam Taggart
CLA, CPI, CTD, LabVIEW Champion
DQMH Trusted Advisor
Read about my thoughts on Software Development at sasworkshops.com/blog
GCentral
0 Kudos
Message 2 of 5
(2,079 Views)

Hi Sam,

 

No, they're a unified control, unfortunately: 

 

ErikL68_0-1615572987169.png

 

At least, if they're not, NI's doing a good job disguising it!

 

It's rather annoying when I run into a project where they're left at "instr" when it's not necessary (and I haven't yet run into one where it was) as it leaves out what IMHO is useful functionality - especially with probes - that is added for the "Serial Instr" type.

 

Thanks,
Erik

0 Kudos
Message 3 of 5
(2,059 Views)

Please try with attached VI.

It will convert all VI Resource Name available on FP to Class Name you have Mentioned. You can provide either I/O session names or Event Class Names. 

0 Kudos
Message 4 of 5
(1,837 Views)

Hi Jalel,

 

Sorry, no, it doesn't seem to be working. I tried it on a VI with both a VISA Refnum control and indicator, both of class "I/O Session -> Instr", and tried to change them to "Serial Instr" and neither changed. The converter VI didn't throw an error either.

 

Please unlock the VI you next post. I prefer not to run anything that I can't see the source code behind unless it's from a trusted source, and you're not a trusted source, sorry! If the next version you post is password-locked, I won't be running it.

 

Thanks,
Erik




0 Kudos
Message 5 of 5
(1,831 Views)