01-21-2018 02:37 PM
Hi all,
I am new to DASY lab and I would like to automate measurements of all 16 channels for every second from the signal starts using a script block which supports python.
Herewith i have attached an image of a signal.
There are two red dots in that. First red dot is start of the signal with time t=0.
Second red dot is the time that the signal starts triggering, let us imagine t=x.
From x, every second signal has to be recorded and writes data in a file.
Kindly help me with your inputs how can i proceed to automate it.
Thanks in advance.
01-22-2018 07:55 AM
First, before programming, have you evaluated the Trigger modules?
If these do not work, and you want to attempt the Python Scrip approach, then I would recommend that you use it like a Trigger, where the input is evaluated based on your criteria (time = x). The output would then be a control signal, 0 or 5 (Off or On) that would control a Relay. Of course, you can decide how you want to have it work.
Start with the basic "As many Inputs as Outputs" script settings. Take some time to review the Help and the simple example that the Help describes. Other examples can be found at kb.mccdaq.com (search for DASYLab Script).
You will want to be able to extract the time stamp from the data block header. This will give you seconds since Measurement Start.
If you would rather set the Script module up to directly output the data, rather than using a control signal/relay approach, you'll have to manipulate the ProcessData data function to skip every other data value. Take note of block sizes and sample rates as you do this data reduction and reduce them accordingly.
01-22-2018 08:13 AM
Hi CJ,
Thanks for your information.
I have worked out few examples like creating a package for a function f=ax+b.
I have a measured data files(*.asc) of the signal from worksheet and i would like to extract the data with the conditions(related to timestamp) using script module. I thought creating a package can be reused for all the measurements.
I would like to monitor all the available channels (16), since each signal from a particular channel will have different start trigger time.
-Sangeetha
Kongsberg Automotive
Munich
01-22-2018 08:39 AM
Sangeetha,
If you are in Munich, it might make sense to contact www.measx.com directly for assistance. They have excellent resources and experience with DASYLab and the Script module. You will get more personal assistance, as well as good suggestions for how to proceed.
01-22-2018 09:02 AM
Hi CJ,
I will contact them and thanks a lot for detailed information.
Thanks,
Sangeetha.
01-24-2018 03:21 AM - edited 01-24-2018 03:27 AM
I am not sure if I understand the request correctly, but here's a "rapid prototyped" solution.
Explicitly offered as alpha/untested, use at own risk!
But it might guide the direction for your own script.
The script module blocks data until the "wait time" has expired.
Then, it outputs blocks of size 1 repeatedly: The "peak time" is the pause time between outputs.
The screenshot shows an example.
Red signal waiting 3 seconds, then 1 value per second
Blue signal waiting 5 seconds, then 1 value per 2 seconds