05-29-2017 02:45 PM
Hi DASYLab community,
Past few days I've been getting acquainted with DASYLab and I think I am starting to get a rough idea of what I can and cannot do. Recently I began working on a project where I am collecting accelerometer data based on a bunch of set conditions. So far I can easily pass the data to the write module with the required manipulation, find the maximum./minimum values over the run time and send them to a separate run module (not 100% on this one actually). Where I am running into problems is the following:
1. scanning actively, but only recording values that are outside or inside a certain range of values
2. actively scanning 3 sensors and comparing if either of the two (slave sensors) are within 5% of the third sensor (master) at any given time.
Originally, I thought I could achieve this with start/stop triggers until I figured that they only outputted high or low. whoopsie. Now I am trying to achieve the same results using an action module. As far as scanning for the condition, it works great, but I am having trouble writing it to file. I wanted to pass it through a digital meter which is connected with my write module, but I cannot seem to get that work correctly. Any advice on what I can do to remedy this issue or maybe a better method to achieve my goals? If additional info is required, please let me know.
Cheers,
Stephen Abraham
Solved! Go to Solution.
05-30-2017 07:26 AM
I'm glad that you've figured a lot out!
1. Use a Combi Trigger or a Pre-Post trigger to determine whether the signal is in or out of range.
Use the control output of the trigger to control a Relay to hold or release data.
If you are working with multiple signals, and want to control them together, use the Arithmetic - all channels to do an AND or OR operation before the Relay.
2. you'll need to add some math - for the master sensor, do an arithmetic with two inputs, branch the master sensor into both. For the lower bound, multiply by 0.95, for the upper bound, multiply by 1.05. Connect the outputs to a Write Global Variable module and write to variables 1 and 2.
Set up a Combi Trigger or Pre-Post Trigger to use the global variables as the range (use ${VAR_1} or ${VAR_2} ). Use the control output to signal that the values are out of range. You could use the Comparator also.
06-01-2017 10:10 AM
Hi CJ,
Thank you for the advice! I ended up figuring out with your advice that using the start/stop trigger was the wrong one for my purpose and ended up switching over to a combi trigger for comparing the master with the slaves and checking if the values went out of range! I also ended up using a functioning interpreter instead, but it seemed to work out as well!
One more question if you don't mind me asking. Another thing my program is going to have to accomplish is recording the elapsed time between each max and min value. In order to do that, I feel that I would use a time base module to run parallel with my min/max module and use a relay+trigger to activate it, is that correct to assume? If not, can you recommend a better approach?
Cheers,
Stephen
06-01-2017 10:18 AM
If you are using the Statistical Values module, you can do a Max Position and Min Position to extract the time stamp of the maximum and minimum in seconds. You should be able to subtract one from the other to get the time.
06-01-2017 10:59 AM
Is there a way to set a hysteresis for the statistical values module? My current max/min is set to identify extrema's that differ by atleast 0.05g's.
06-01-2017 11:27 AM
Are you using the Min/Max module?
If so, then use the Time Base module to extract the sample time from each extrema.
06-01-2017 12:17 PM
Yes I am! Could you run me through how I can go about doing that?
06-01-2017 12:24 PM
Opps, nevermind, I was being silly and not thinking there for a moment.... Thank you for all the help!!