05-18-2022 12:49 PM
Here's a long shot. I have some RT controllers that occasionally will be wiped and the test software is reinstalled on them. The VISA resources are named things like "PSU_1" and "Chamber_1", and the software just references those names. But internally it is rare that the PSU_1 isn't ASRL3::INSTR, and it is rare if Chamber_1 isn't ASRL5::INSTR. So I was hoping that I could look at the VISA naming at the start of my software, and if ASRL3::INSTR isn't named PSU_1, then to name it that. Is this possible? For the moment I've just decided to read the aliases and if there is a label PSU_1, then to use that, and if there isn't then use ASRL3::INSTR. Is there a way to rename VISA resources from a VI running locally on the RT target?
Similarly I'm trying to do something with the XNet resources. I have 4 CAN ports all labeled CAN 1 to CAN 4. But after a reinstall the naming isn't always in order from the first to the last. Is there a way to rename XNet resources from a VI running locally on an RT target? I think I might take the same approach, and just read the device location in the chassis, and then use the first one, even if it is named wrong.
Yes I know both of these can be renamed and fixed in MAX, but I want one less step in the setup and configuring of these chassis. I'd prefer it if the software can just on first run, set them. Thanks.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
Solved! Go to Solution.
05-18-2022 01:30 PM - edited 05-18-2022 01:41 PM
The System API filters WILL find resources by descriptors AND the System API has a Rename Alias function. Renaming an Alias will even work if another resource is consuming that Alias string by Resetting the existing resource's Alias to default regardless of the value of property.IsPresent? (Unlike MAX which forces you to clear the Alias and save first before reassigning the reserved Alias Value.)
You can also inspect resource properties for vendor ID, model, SerialNo, cal due date, etc...(any property MAX can see)
BONUS: The System API functions read and write data directly to/from xmlhell ( a/k/a the MAX Database)
I've NEVER tried it in code on an RT target, I think it is supported. I would prefer sticking configuration inside a host or, if you a headless, the installation should be configuring the RT System. You dissalow idiots....er, I mean uhm Users, from messing with USB connections right?
05-19-2022 09:11 AM - edited 05-19-2022 09:24 AM
Serendipity rides again!
I just found this old post for another thread
The thread even has this link Introducing the API about a decade ago.