adamLL Posted June 22, 2022 Share Posted June 22, 2022 Is there any good way to get a value from a variable from a python environment into a channel/variable value in DAQFactory? I am currently using an instrument that will only let me easily read its outputs with python. My current idea is to have a python script that reads the output from the instrument, and then writes it to a file. Then I would use DAQFactory to read the file in as the channel value. Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted June 23, 2022 Share Posted June 23, 2022 There are probably lots of ways, but the easiest is probably to do what you described and use a file. Use the File. functions within DAQFactory to read the file. Quote Link to comment Share on other sites More sharing options...
adamLL Posted June 23, 2022 Author Share Posted June 23, 2022 Thanks for the help. When I store this value in a channel, would it be best to use a V: channel or a test channel. I'm a little confused on the difference between those two. Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted June 27, 2022 Share Posted June 27, 2022 V channels are largely deprecated, so I wouldn't recommend them. They are left over from when we didn't have variables (like 18 years ago!), but so many people seem to use them that we can't really get rid of them. I think people like it because you can see the contents in a table? Other than this, and the fact that assignment to a V channel does the equivalent of AddValue() on a variable, a V channel is basically the same as a global variable. A channel, however, has added features such as persist, conversions, and other things. If you are getting an input value from the python script that is basically an I/O point, I would use a Channel. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.