Search the Community
Showing results for tags 'Virtual Channel'.
Found 2 results
BallardHill posted a topic in Channels, Conversions and general data acquisitionIs there example code for: 1) Using computed data added into a Virtual Channel with Time; 2) That can then drive a Graph Trace 'real time'; Need this in a testbed to investigate why a Persistent Max value drops once the Peak Value shifts out of History instead of Persisting.
cragjumper posted a topic in DAQFactory and the LabJackHi all, I've got my U3 measuring duty cycle using Timer0 and Timer1. Since I'm streaming the data, I've set up the configuration using sequences and setup four channels to read Channel 200, 224, 201, 225. I'm confident that I have the streaming working properly and am able to log the raw data (which consists of 4 elements - the LSW,MSW of Timer 0 and LSW,MSW of TImer1) without any issues. However, I'd rather not have to calculate the duty cycle for tens of thousands of points from the raw data for every one of my log files in excel. As such, I've been able to calculate the duty cycle within DAQFactory using both virtual channels and test channels. In my virtual channel, I've simply written the expression to calculate the duty cycle using the results of my data channels. My test channels receive the results of those same expressions from the Event tab of channels 224 and 225 using the AddValue command. So, I feel I can successfully calculate duty cycle values using two different methods. However, the issue is in trying to correctly log them. 1) From what I've read, I believe logging will not work with virtual channels, and as such must be recorded using export. However, I think export only exports the history of the channel, so if you happen to exceed the history, you'd be losing data. Is there another way to use Virtual Channels to actually log, rather than export, data? 2) When using the event tab of channel 224, I use the following expression to calculate duty cycle from the raw data for the LSW and MSW: DutyCycle_Calc.AddValue(DutyCycle_LSW/(DutyCycle_LSW+DutyCycle_MSW)*100) where DutyCycle_Calc is my test channel. When I use this form, nothing is logged from DutyCycle_Calc. However, if I use this expression instead: DutyCycle_Calc.AddValue(DutyCycle_LSW/(DutyCycle_LSW+DutyCycle_MSW)*100) I log a duty cycle value every few milliseconds but have a large number of raw data logged in between. I believe this is because the event is only being triggered when the packet from the streaming is written, and since the  only looks at one element of the package, only one piece of data from the packet is used to calculate a duty cycle. Is there a way to record a calculated DutyCycle for every piece of raw data that was streamed within a packet and have it logged? 3) On an unrelated note, does the channel # of a test channel matter? Or can these be arbitrarily set? Honestly, I'm still not clear on how to use test channels properly and couldn't find any direct explanations in the DAQFactory Manual. Any pointers to references would be greatly appreciated. If there's an easy and obvious answer to any of these questions (calculate in sequences and then somehow log the values?), I apologize, but I'd really appreciate some help either way, as I've really put a lot of time into figuring this out and haven't found a solution yet. Cheers!