From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

DASYLab

cancel
Showing results for 
Search instead for 
Did you mean: 

create a channel of user-input triggers

I need my data acquisition system to have a channel that saves user input as triggers. basically saving the timestamp of a key or mouse button press. preferably with an indication of what type of an event it was (start/stop, events A/B/C/D, etc.)

 

I tried to understand from the manual whether DASYLab has this ability, but so far I didn't come across something similar.

1) Can someone confirm if DASYLab has or doesn't have this ability?

2) If not, can I create a script module that does that?

3) Does someone have an example of a similar script module?

 

0 Kudos
Message 1 of 2
(1,768 Views)

Hey Pnina,

 

DASYLab cannot trap mouse clicks or keyboard key events and I don't see a solution using the Python Script module. This is because a Python script runs inline with the rest of the worksheet modules. Because of this, it cannot use an infinite loop or input statement that would hold up execution. Instead, it must perform its task and exit so that the next DASYLab module can do its thing.  

 

Best regards,

John

0 Kudos
Message 2 of 2
(1,745 Views)