Page 1 of 1

NumGate changes 0 to 1, report exact date&time

Posted: Sun Jul 26, 2015 4:30 am
by bctBCT76
Dear All,

is there any way I can save in a report date and time when an out NUMgate sets to 1 (previously 0) and viceversa?

26/07/2015 06:26:15 1
26/07/2015 07:12:34 0
...
...
...
27/07/2015 03:34:23 1

Thanks a lot

Re: NumGate changes 0 to 1, report exact date&time

Posted: Thu Jul 30, 2015 9:08 am
by admin
Dear Sir,
Yes, you can do this by code, for example:

Code: Select all

Function void mainLoopSave()
#startup

    int prevValue = GetDigGateValue("Test", 0);

    While(WindowIsOpen())

        if (GetDigGateValue("Test", 0) != prevValue) then
            ReportAppendRecord("myDatReport");
            prevValue = GetDigGateValue("Test", 0);
        end

        Sleep(300);
    end
end


Best regards

Re: NumGate changes 0 to 1, report exact date&time

Posted: Tue Aug 04, 2015 4:12 pm
by bctBCT76
Hello,

I can't get it to work, no report is created at all.
Please note that I'm using a NUM gate not a DIG gate, anyway even changing the GetDigGateValue to GetNumGateValue the file is not working nor saving any report.

Please let me know why
Thanks
Tiziano

Re: NumGate changes 0 to 1, report exact date&time

Posted: Wed Aug 05, 2015 7:10 am
by admin
Dear Sir,
can you post your application please?

Thanks