problem with stimulation codes using run command

Concerning processing components: filters, file load/save, visualizations, communication ...
Post Reply
yanli
Posts: 16
Joined: Wed Oct 14, 2020 11:43 am

problem with stimulation codes using run command

Post by yanli »

Hi,
I’m trying to start our electrical stimulation during a MI trial by using the run command box . However we experience some problems with the configure setting.
Our plan is that after the cue shows and the EEG is classified as the correct hand side of motor imagery , the electrical stimulation sets to be activated.
1. So we make our setting like this ↓:
Image
When OVTK_GDF_Right and then OVTK_GDF_Feedback_Discrete detected, the electrical stimulation will be launched.(“If you want asynchronous call, then you have to postfix the command with & under”,http://openvibe.inria.fr//documentation ... mmand.html)
==>PROBLEM: we can get the feedback, but the electrical stimulation does not launch.
And if we delete & (launch the commands synchronously), it works, although the cue and electrical stimulation start together
:cry:


2. Then we set like this ↓:
Image
==>PROBLEM: the electrical stimulation still can’t launch.

3. Only when set like this ↓ can it work:
Image
==> the electrical stimulation can work successfully ,BUT the cue and electrical stimulation start together

We have no idea how to fix it. Any help is appreciate.

Thanks

Thomas
Posts: 69
Joined: Wed Mar 04, 2020 3:38 pm

Re: problem with stimulation codes using run command

Post by Thomas »

Hi,

I see that the stimulation OVTK_GDF_Right launches R asynchronously, and the stimulation OVTK_GDF_Feedback_Discrete launches the program ChannelOne.exe.

I am sorry, it is not clear for me what R and ChannelOne.exe are respectively doing, and how they are supposed to do it, so I feel like I miss information to help you.

The RunCommand box is relatively simple and executes a system call with the command provided when receiving the matching stimulation.

If the command is going to take some time to execute, it is advised to make it asynchronous with '&' indeed, otherwise OpenViBE will be stuck until the command returns.

The other thing I am thinking about is that the command, when launched asynchronously might still take some time to launch, and OpenViBE is still running in the meantime, so synchronisation might not be as expected.

Hope this helps. Don't hesitate to provide more details.

Cheers,
Thomas

yanli
Posts: 16
Joined: Wed Oct 14, 2020 11:43 am

Re: problem with stimulation codes using run command

Post by yanli »

Hi,

Thanks very much for your answer.
Sorry for forgetting to list details when asking. Let me hastily add, ChannelOne.exe is switch of the electrical relay(when launching it, electrical relay starts to give out electrical stimulation).
R is a random value using to just find out OVTK_GDF_Feedback_Discrete after OVTK_GDF_Right stimulation. When launching it, there may appear :
''R'' is not recognized as an internal or external command,operable program or batch file.
in OpenViBE cmd window, but no influence on OVTK_GDF_Feedback_Discrete, so matching command ChannelOne.exe can still work normally in theory.

On the other hand, in our last post we find that only without using OVTK_GDF_Feedback_Discrete can our electrical relay launch successfully. And the cue and electrical stimulation are supposed to start together.

Ha! Now please ignore the problems described in the last post. Our new goal is to let electrical stimulation appears together with the cue.
1. We use the settings mentioned by the third image in last post to realize it, but we find that electrical stimulation starts before the cue appears. In brief, execution sequence may be wrong.
2. Moreover, when carrying out the mi-csp online test, Graz Visualization box does not receive feedback,namely no blue bar be seen.

Now that we know ” OpenViBE will be stuck until the command returns” , truly we find current time of scenario… in openvibe stops when executing run command.
WE would like to know how to exactly set run command configure to let the cue and electrical stimulation start together.

Thanks
Last edited by yanli on Sat May 08, 2021 4:44 am, edited 1 time in total.

yanli
Posts: 16
Joined: Wed Oct 14, 2020 11:43 am

Re: problem with stimulation codes using run command

Post by yanli »

Hi again,

I guess is it something about serial port ?
I read about the tutorial Overview: Sending data & stimulations to/from OpenViBE(http://openvibe.inria.fr/overview-sendi ... -openvibe/),and it seems that Do-It-Yourself is not currently supported, right?
It is sometimes asked if the serial port or parallel port can be used to send data or stimulations to. This is not currently supported, as there is no standard what to write to the serial port.
So any help about how to make a serial port (in order to start my electrical relay mentioned last post) is appreciate.

Thanks a million

Thomas
Posts: 69
Joined: Wed Mar 04, 2020 3:38 pm

Re: problem with stimulation codes using run command

Post by Thomas »

Hi,

Sorry if I get confused with what you are trying to achieve here. Also the pictures you uploaded won't show anymore...

Technically, if you want the cue display and the feddback to start simultaneously, you want them to get triggered by the same stimulation(s).
If they do and still appear with some delay, then they may need stronger synchronisation, which as you mentioned might need "doing it yourself".

Even though there is no standard way of sending data to serial port, you can surely use a library (as mentioned in the link you provided) in order to implement the serial communication you need in an OpenViBE box.

Hope this helps,

Thomas

yanli
Posts: 16
Joined: Wed Oct 14, 2020 11:43 am

Re: problem with stimulation codes using run command

Post by yanli »

Hi,
I got it.Thanks so much!

Post Reply