04-27-2023 04:36 AM
Hello all,
I am currently working on a project using NI VeriStand 2021 R2, doing some RT measurements using niveristand-python.
The task is to measure the on-duration of several analog input channels of a PXI system.
To make my code reusable I am searching for a way to set the input channel as a parameter of the function that is calculating the on-duration.
As far as I understand, I would need to set a ChannelReference as a parameter...By now I was not sucessfull.
Does anyone have some suggestions for this?
Thank you!
PS: attached is some example python code that is working but using a fixed channel
04-27-2023 08:26 AM
If you want to reuse the python script on different VeriStand projects, you should configure all those VeriStand projects to have the same channels name.
04-27-2023 08:47 AM
Well, ok...
But how can I handle different channels in the same VeriStand project without hard-coding them into the python module?
Any ideas?
Thank you.
04-27-2023 09:07 AM
You can use the user channels. Hard code the user channel name in the python script, then change the mapping in VeriStand project as needed.
05-02-2023 12:23 AM
Thank you @ZYOng for your reply.
I know I can also go with the user channels. But hard coding is not the solution I am looking for.
However, it seems there is no other way for handling this problem.
06-27-2024 09:27 AM
Hello ... Did you ever find a workaround for this ... I am trying to do the same thing but the Python implementation for Veristand is very limiting as well as incredibly non-pythonic.
Thanks
Randy
06-27-2024 11:57 PM
Hi,
yes I found a workaraound.
I wrote a small python script that modifies the real time sequence file (it's an xml file). It changes the Default Channel to the channel I want to test.
I am then calling this script cyclically from within a TestStand sequence.
Regards
Johannes
08-27-2024 07:40 AM
Do you mean you are changing the