05-19-2015 03:45 AM
I have used DASYLab to read information via the RS232 input module and read 6 channels of information real time. Whilst the program is running, I would like to be able to look at one of the channels and based on deviation from a set point, open a data file (ASCII), read out the data and display it on the screen real time (digitally) along side the actual data (plot) for that channel. Thanks
05-19-2015 07:55 AM
Yes, you can do that.
You need DASYLab Full or Pro, and the files that you plan to read need to be symmetrical -- the same number of channels, the same file type, and the same general timing characteristics.
The Read module is set up to use a global string to specify the file name. It cannot use original date/time.
I created six files that only differed by amplitude, each with 100 samples in it.
I have a Coded Switch to select the file.
It's connected to an Action. When the Coded Switch changes, the Action copies the file name to the Global String that the Read Data module uses. Then, when that Global string changes, the Read module is reset, and it reads.
Note that it will always read once at the start of measurement.
Attached is an example with the files, the worksheet that created the files, and the worksheet that will read the files. Look at the Action and look at the global strings. Note that in the Read worksheet, String 1 is a formula - click on definition to see the formula.
05-19-2015 08:15 AM
Many thanks CJ, I will have a look at your coding and give it a go.
05-19-2015 08:32 AM
First problem, and it is my fault entirely, is I didn't say what version of DASYLab I was using. I am actually using V10 so I can't open your files.
05-22-2015 01:23 PM
Here are the files stored as .DSA.
Copy both .DSA and .DMX to the same folder to open.
Then do a File Save As... to store as .DSB.
05-26-2015 02:24 AM
Thanks CJ. I managed to download and install on my home PC DASYLab 12 so was able to look at your code. With a bit of tweaking it will do exactly what I require so many thanks. Finally, I would like to run the code at a specific time so as not to have it running from the start. I am essentially looking at the point 1 channel of pressure starts to drop. When this happens I would then compare it with the data in the ASCII file. Can this be done?
Many thanks once again.
05-26-2015 07:16 AM
Unless I am missing something ${DATA_FOLDER} system variable doesn't appear to be valid in V10. Is it called something else?
Thanks
05-26-2015 07:19 AM
I need to review your request, but I think that it's an Action module with an Action controlled relay, so that both the reset event /action and the close relay action happen at the same time.
For the global string... no, it did not exist in V10.
05-26-2015 07:34 AM
So I guess I will have to wait until I have V12 installed at work to use the code you attached.
Many thanks again for your help.