06-10-2014 04:55 PM
Hi forum,
first of all thanks for your help i am new in labview and the forum helps me a lot:).
I am trying to implement an event counter, every time a a value gets from true to false the counter should increase in the end of the data acuisition the counter should be written to file.
I am using a shift register right now for counting the events, its works fine iam in trubble writing the the event counter to file as soon the application is finished can someone help me please or has a idea?
Thanks and best
Martin
06-10-2014 07:59 PM
06-10-2014 09:37 PM - edited 06-10-2014 09:39 PM
Hi Martin88,
Please use the state machine architecture as below.
You should have atleast four states; initialise, acquire, log and stop.
When you will press stop, the logging state will execute first ensuring the data is logged and finally the stop state to stop the program.
06-11-2014 12:25 AM
Hi,
sorry about the post. I would like to implement a event counter what i reallized with a shift register it works fine.
In the end of the recording i would like to write the last value of the counter, what would be a ASCII number, into a txt file.
The text-file should look like this with two columns:
Event_x: counter
Event_1: 5
Event_2: 6
Event_3: 1
Event_4: 0
thanks
Martin
06-11-2014 05:59 AM - edited 06-11-2014 06:02 AM
The following code will do exactly what you require.