10-23-2020 07:46 AM
Thank you again M. CJ for your feedback.
I think I was not clear enough in my description of the problem.
on the photo we notice the signal peaks in high amplitude (blue color), as well as those in low amplitude (green color). The goal is to record the pikes separately, file 1 for high amplitudes peaks, and file 2 for small ones.
In the program you suggested to me, it simply defines the peaks of the signal. this was i aleardy do by combining min/max fonction (ttl output) to relay.
10-23-2020 10:15 AM
That example split the signal using the rectangular signal in the file.
If that doesn't do it for you, then you need to provide the criteria for how you distinguish the high pressure from the low pressure.
Of course you can see it on the signal, but DASYLab isn't AI -- it needs criteria to split the signal.
I've tried a couple of other things, but this was the best. Looking at the rectangular signal, it doesn't line up on the high peaks only.
10-23-2020 11:00 AM
If I have a threshold range defined (I used global variables and -110 and 110 as the low pressure range), you can do this.
The blue and green values are in two different channels, which can now be saved to individual files (not the same file).
10-24-2020 03:35 PM
Thank very much M. CJ, this is exactly what i was searching for. I did the modification to get 4 output fil, the formula fonction work perfectly. Instead of the high and low value, I replaced by percentage.
I tried differents methods before ( mean, comparate, .. ) i always loose some data. this way work perfectly.
10-27-2020 10:04 AM
Im back with another problem with this project.
I add a start stop trigger and counter to have the cycle number, and coupled the relay to get the number with the peaks value, but i get error on the relay module.
" the time information or block lenght of the input channels do not match. The channels cannot be lineked in this module. STOP"
I did the same process in my old project ( the mean methode and comparator) and its worked normaly.
What I forget ?
10-27-2020 10:23 AM
The output of the min/max is single values, at irregular intervals.
The input of the Relay has a control input and a data input. The Relay expects both to have the same timing characteristics (sample rate, block size, start time). That's why it won't work.
Can you attach an example worksheet? Perhaps my example modified to show the error?
10-27-2020 10:28 AM
attached the example (your's with the modification).
i did it for one relay to test.
10-27-2020 10:43 AM
Your data file has three channels. The previous one was two channels. Can you upload the new file?
10-27-2020 10:48 AM
Its the same file, just cannot read the forst one ( some issues with read module) so i changed it to .txt with three channels to visualize the signal. Attached the modified file.
10-27-2020 10:58 AM
I cannot test the attached, but it should work.
Split the counter from the rest of the logic, store the result in a global variable (#3). I fixed the counter to count rising edges cumulatively.
Each Relay has different timing, so you need four Read Variable modules, one for each Relay. Use one of the other Relay inputs to give the Read Variable a time signal.