Event triggered Log File


Hi everyone.

Background first – New to OPTO 22, SNAP PAC training scheduled for July, but need to start sooner…

I am trying to set up an event triggered log file so I can save the entire time sequence of a complex process. The current software uses Historical logs in several groups varying from 500ms to 1 hour in time.

These files are then analyzed off line to derive what we need.

I would prefer to detect the finish of a process and save all information to a single line in an event triggered log. Some events happen every few days, others happen several times an hour. I would like to create separate logs for each.

It is mentioned in the manual, but no detail on how to set one up.

Thanks in advance for helping an OPTO 22 rookie…



Hi Rick,

I find that the in-program Help sometimes explains things better than the manual if you haven’t looked there.

If you click on the Help button inside the log configuration it will explain what each item on the dialog does.

Below I configured a log that will log one sample of FLOAT_1 when INIT_1 (the start trigger) becomes true (non-zero).


Thank you very much. I had not looked that deep in for invoking help.

I am exploring the current Project off line and it uses Integers as Binary tests. Can I assume that setting one of these as the Tag Name, selecting Discrete and setting this tag to a (Positive?) non-zero value will trigger the logging and setting Number of Samples to 1 will accomplish my intent.

To ensure capture, how long should the Triggering Tag Name stay asserted? Can I reset to 0 after 1 second and assure capture or must this be determined by experiment?

Thanks again.



Positive or negative, doesn’t really matter. I usually use -1 and 0 to represent true and false for my integers being used as booleans.

When you click the ? to select the tag, there is a refresh interval - that is how often PAC Display will check the variable to see if it changed. So if you set this for 1 second, then you will want your trigger to stay true and false for at least that long- I would go 2-3x longer to be safe.


Thanks again.

A nice upgrade would be the option to reset the flag when the trigger is detected and the logging begins.

I prefer closed control.


FYI - this post on “what’s true?” may be of interest to you also:


I haven’t tested this myself, but you may be able to setup the same start trigger point as an alarm point and have it clear itself in the alarm notification option. Now if you are using alarms in your project then this could be annoying.


I would worry about using the alarm to clear the flag because if it acts before the logging is initiated, no Logging.

Off topic, but since I have a competent ear…

We are doing a turn on our interface board and to clear up some cabling tangle issues, I need to move a configured SNAP-IDC-32 Module from Slot 2 to Slot 9. I have not found a method to move the entire configured Module. Since many other things will also move, I want to learn shortcuts if possible, before starting the hard way…


On the alarm thing, you can change the persistence time under the “More…” button on the Discrete tab of alarm point configuration. This will cause the alarm to wait that length of time before triggering.

You can move a point to a different slot through PAC Control Configure I/O points. I believe you have to move one point at a time. Sometimes you need to move it to a temporary slot first if you are trying to swap two modules positions. It would be nice to be able to move the entire module, but I don’t think that is possible outside of manually editing an exported tag database and then importing it back into your strategy.


Are you using the latest PAC Control?

From the readme for R9.5a;

Move modules or points. In addition to moving an I/O point, now you can move an
entire I/O module and all its points to a different position on the same I/O
unit or to an open slot on a different I/O unit.


Actually, there is a (new-ish) “Move Module” option in PAC Control now!
Super easy!


Awwh, nice! Last time I had to move points around it was for a customer on 9.3.


Sweet. except we have not moved to 9.5 or above yet… Still at 9.4… groan…lol.

And too many changes happening simultaneously to have the additional variable of a software upgrade to the risk matrix…


One more little comment, since I am moving lots of points manually.

Consistency of naming: When I move from, it is A0 to A7, B0 to B7, C0 to C7 and D0 to D7.

The destination of the move to is 0 to 31…


More on triggers… (I finally got to this project, delayed since April, and am trying to make it work…)

I am troubleshooting some intermittent issues and decided to log some data whenever a change occurred to learn about using triggers.

While the loop in PAC Control is operating every 250ms, I did not want to check that often with PAC Display, so it checks every 500ms for the trigger.

I wanted at least 2 periods, so when a change is detected, the trigger is set to 1. On following loops, if the trigger is > 0, it increments. If it is >4. it resets to 0.

When I executed this code, I sometimes got more than 1 log of a data set. (There is a unique counter logged, so if the counter doesn’t increment, the same data is saved twice.)

I didn’t expect this. I changed the code to set the trigger to 1 and start an UpTimer. I then check the Uptimer and if >1, reset the trigger and stop the Uptimer.

I now get 1 and only one log of each captured data set. (Some data is not logged, if more than one change is detected while the trigger is already True, bu this was expected by the method).

I didn’t expect this to change the behavior. The Trigger went true when it went from 0 to 1. There should not have been any change when it went to 2, 3 and then 4. So why did I get multiple log entries with the original method?

I would like to try using a DownTimer set to 1 second as the trigger. This would then automatically reset, saving the checking. But if a changing value triggers a log event, this would result in multiple logging. Still open loop, but less code…


One more question:

When a trigger is detected, does it immediately log the data or does it wait for the group that logging is assigned to?