ONECore Posted January 19, 2021 Share Posted January 19, 2021 I would like to ask the user for an input with a Variable Value Component and have it span several channels. I have am using the Action Set To and my Action Channel is Channel.*ChannelName1*.timing. I want this to go to another channel (ex: Channel.*ChannelName2*.timing) as well, but putting this in Action Channel doesn't update the second channel. I try to separate the Action Channel's by a simple space, a comma, a period, and a semicolon. Notta. If I add another action Set To, it asks the user for a second input. I cannot allow this. How can I ask thee user for one input and have it span multiple channels? Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted January 20, 2021 Share Posted January 20, 2021 Two ways: if you always want the input from one to go to a second channel, just use the event of the first channel. So say you have ChannelA and ChannelB. In the event for ChannelA put: ChannelB = ChannelA[0] Then every time you change channelA, it will also change channelB. Just DO NOT also put the event in ChannelB! Otherwise you will get a loop and hang DAQFactory! The other way would be to use script to ask for the value. The general template (with added duplication) would be: private string data = system.entryDialog("Enter a new Value:") if (!isempty(data)) channelA = strToDouble(data) channelB = strToDouble(data) endif Quote Link to comment Share on other sites More sharing options...
ONECore Posted January 21, 2021 Author Share Posted January 21, 2021 Brilliant, thanks! FYI, anyone else, the system.entryDialog can take min, max, default, and other stuff. And I wanted to change only the timing aspect of the channels, so my quick script became: private string datain = system.entryDialog("Channel Timing (all channels):",0.005,,channel.channelA.timing) if (!isempty(datain)) channel.channelA.timing = strToDouble(datain) channel.channelB.timing = strToDouble(datain) endif 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.