NumGate changes 0 to 1, report exact date&time

Discussion about reports creation (CSV,RTF,DOC,PDF etc.).
Post Reply
bctBCT76
Posts: 27
Joined: Wed Jun 24, 2015 11:39 am

NumGate changes 0 to 1, report exact date&time

Post 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

User avatar
admin
Site Admin
Posts: 354
Joined: Tue Nov 17, 2009 1:18 pm

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

Post 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

bctBCT76
Posts: 27
Joined: Wed Jun 24, 2015 11:39 am

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

Post 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

User avatar
admin
Site Admin
Posts: 354
Joined: Tue Nov 17, 2009 1:18 pm

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

Post by admin »

Dear Sir,
can you post your application please?

Thanks

Post Reply