Use of SOEEventAdd()

Hello,

I need to log operator events for Text field and buttons

I tried SOEEventAdd() for

a. Button as 

INPUT-->TOUCH-->UP

Toggle(Tag1);
SOEEventAdd(TimeIntToTimestamp(TimeCurrent()),"mymsgButton");

I need to add Tag value in the Message of SOE.(old value and new value)

b.Text Field

INPUT-->KEYBOARD COMMANDS-->####ENTER

Tag1 = Arg1;
SOEEventAdd(TimeIntToTimestamp(TimeCurrent()), "mymsgTextBox");

I need to add Tag value in the Message of SOE.(old value and new value).

For part b need Formnumpad to be open after left click.(I tested it but SOE is not working after this modification)

Please reply.

Thanks.

Parents
  • If you're familiar with Cicode, you could make input functions that store the current value, prompt the user for a new value, write to the variable, then write the old and new values to SOEEventAdd(). That also makes it easier to keep your project consistent since most of the commands will be in one Cicode function instead of having dozens of copies in each button in your project.

    However, if you want to try to just do it in the button you could define a Local Variable (Citect Studio | System Model | Variables | Local). Name the variable something like LastValue and make it a string type. In the button command, first copy the variable tag value into LastValue. Then copy your input value into the variable tag. Then, pass both to SOEEVentAdd(), like:

    LastValue = Tag1;
    Tag1 = FormNumpad("Enter tag value", Tag1, 0);
    SOEEventAdd(TimeCurrent(),"Tag1 changed from " + LastValue + " to " + IntToStr(Tag1));

    Instead of IntToStr() you'll need RealToStr() for floating point values. The shorter way to convert numbers to strings is to use the format operator and specify the number of digits, like Tag1:##.###

    For example:

    SOEEventAdd(TimeCurrent(),"Tag1 changed from " + LastValue + " to " + Tag1:####);
Reply
  • If you're familiar with Cicode, you could make input functions that store the current value, prompt the user for a new value, write to the variable, then write the old and new values to SOEEventAdd(). That also makes it easier to keep your project consistent since most of the commands will be in one Cicode function instead of having dozens of copies in each button in your project.

    However, if you want to try to just do it in the button you could define a Local Variable (Citect Studio | System Model | Variables | Local). Name the variable something like LastValue and make it a string type. In the button command, first copy the variable tag value into LastValue. Then copy your input value into the variable tag. Then, pass both to SOEEVentAdd(), like:

    LastValue = Tag1;
    Tag1 = FormNumpad("Enter tag value", Tag1, 0);
    SOEEventAdd(TimeCurrent(),"Tag1 changed from " + LastValue + " to " + IntToStr(Tag1));

    Instead of IntToStr() you'll need RealToStr() for floating point values. The shorter way to convert numbers to strings is to use the format operator and specify the number of digits, like Tag1:##.###

    For example:

    SOEEventAdd(TimeCurrent(),"Tag1 changed from " + LastValue + " to " + Tag1:####);
Children
No Data