DASYLab

cancel
Showing results for 
Search instead for 
Did you mean: 

Counting and want to save the final count to a recorded file; HOW?

I am using DasyLab v10.

Recording a file of pressures with header info (strings and Variables)

 

How do I save the count into a variable so I can save it to the header as variable "40" for example?

I can not find a way to do this.

 

I tried using an action to increment the variable everytime an edge rise is seen for the action.

But this is not incrementing the variable.

 

Is there another way to pass the final count of the counter to a variable or string?  So when I stop the experiment the final value can be saved to the recorded file

 

0 Kudos
Message 1 of 7
(7,205 Views)

What are you counting?

 

In any case there is a "Write to Variable" module that can be use on action or on every block.

 

As for the counting, you should use the "Counter" module.

 

As per saving it to the header, when the application is done, you need to creat an action to open and close the file so that the header will be written to the file.

 

One thing i usually do for counting, I save the varable to an INI file together with the save file, it is a little more dynamic.

 

Tom Rizzo
InSyS Corp.
www.insyscorp.com
Your DASYLab integrator
0 Kudos
Message 2 of 7
(7,202 Views)

My worksheet takes a few fluid pressures and shows the data in meter and graph form.  I am writing the realtime pressures to a file for future playback and analysis.  So the header file cannot be written after the stop of the worksheet. 

 

I am counting a Sample Trigger, when psi goes above a set amount I trigger the count.  I display the count using a meter on the worksheet.  But I want to record this count so when I look at the savedexperiment in the future the count is logged also.

 

I have tried to use an action to move the count into a variable, maybe if you explain to me how to do this I will see what I am doing wrong.  But for now I have tried to increment the variable upon a rising edge at the input of the action module.  I am using a switch to test the function, but can not get the variable to increment.  And I do not see anyway to move the count into the variable register.  I am sure I am missing something.

0 Kudos
Message 3 of 7
(7,194 Views)

First of all, do you waqnt to store the total events or do you want to store each event as it happen? you know, in sync with the pressure channel?

Tom Rizzo
InSyS Corp.
www.insyscorp.com
Your DASYLab integrator
0 Kudos
Message 4 of 7
(7,192 Views)

I really do not mind storing it either way.  Storing it with the pressure values would be OK as the event happens, or as a total count at the end of the test would be OK too.

Whichever would be easier to accomplish.  I tried figuring out how to record the event with the pressures in the saved file, but could not understand how to match the signals without getting an error during Play.

 

All things considered recording the count value with the pressures as another input to the record module would be the way to go.  If this is possible.

0 Kudos
Message 5 of 7
(7,190 Views)
to be able to store the counter variable to the file, you have to make sure that it is the same block and sample rate as the other channles.  To do that, use the read variable module and set it for the variable that you are using for the counter, then select options and in the syncronization section, select input.  Now the read variable module will have an input channel that you will connect to one of the pressure channels going to the write module.  At this point all the channles going to the write module are going to be the same size and it should work.
Tom Rizzo
InSyS Corp.
www.insyscorp.com
Your DASYLab integrator
0 Kudos
Message 6 of 7
(7,161 Views)
I will try this, thanks...will let you know how it turns out.
0 Kudos
Message 7 of 7
(7,150 Views)