system.safemode


Rox

Recommended Posts

I would like to switch to system safe mode from a digital input configured pin at my U3. Tried this sequence on EVENT tag on the digital in channel;

If (channelname[0]==0)
	system.safemode=1
else
   nothing
endif

but this hangs the PC when channel=0 (i guess the thread never ends since the if comand never finishes)

then solved the hang problem running a separate trhead this way;

If (channelname[0]==0)
	beginseq(myseq)
else
   nothing
endif

myseq just has sysem.safemode=1 line.

this works aparently fine, data adquisition stops, graphing stops but daqfactoryexpress looks like not being in safemode (left botton corner SAFE is off and file-switch to safe mode option is not disabled. I mean I can still switch to safe mode manually "again".

am I doing something wrong?

nice forum board ;)

Link to comment
Share on other sites

The digital in channel is kind of alarm signal from a broken sensor output pin. The idea is displaying an alarm on daqfactory and then stoping the running program (graphs and all things stoped until the user solves the alarm problem) all the alarm events are done inside if statement before calling myseq.

I find safemode variable useful for this purposse (there is On/OFF button element also that toogles system.safemode between 1 and 0 action defined, this is user`s manual switch to play/stop program. This button works fine since switches daqfactory to a "true" safe mode.

Just wonder why daqfactory doesn

Link to comment
Share on other sites

The problem is that switching to safe mode stops all sequences. In order to stop a sequence, DAQFactory has to wait until the current statement running in a sequence is finished. Since doing system.safemode = 1 is a statement, it has to wait until it has switched to safe mode, which it can't do because the statement is still running. A bit of a loop. Originally this variable was designed for use in a quick sequence, not a real, automated sequence.

That all said, we have fixed the problem. It will be available in the next release, 5.78, which should be available sometime this week, or the weekend.

Please note that in order to make this work, doing system.safemode = 1 from within a sequence simply sets a flag that you want to switch to safe mode. This flag is checked about 5 times a second, so there can be up to a 0.2 second delay between the time you do the command and the time the system actually switches to safe mode. So, if you did:

? "not in safe mode"
system.safemode = 1
? "should be in safe mode"

you will actually see both ? statements execute. In otherwords, system.safemode really should be the last statement in your sequence, or you should have a return() or delay(1) after it to ensure that no further statements get executed.

Finally, it is of course pointless to do system.safemode = 0 from within a standalone sequence, since you can't start a sequence from within safemode. Of course you could put it in a sequence that is acting as a function, called from the command line or a component action.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.