NumGate changes 0 to 1, report exact date&time

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

NumGate changes 0 to 1, report exact date&time

Postby bctBCT76 » Sun Jul 26, 2015 4:30 am

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: 306
Joined: Tue Nov 17, 2009 1:18 pm

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

Postby admin » Thu Jul 30, 2015 9:08 am

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: 23
Joined: Wed Jun 24, 2015 11:39 am

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

Postby bctBCT76 » Tue Aug 04, 2015 4:12 pm

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: 306
Joined: Tue Nov 17, 2009 1:18 pm

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

Postby admin » Wed Aug 05, 2015 7:10 am

Dear Sir,
can you post your application please?

Thanks


Return to “Reports”

Who is online

Users browsing this forum: No registered users and 1 guest