navFormReceiveReadDateTime (Function)

Top  Previous  Next

Architecture:

NX32 / NX32L

Device support:

MX2 turbo/encore/warp, AX9 turbo, NX-200, NX-400, NX-900, LX2, LX4, LX5

Firmware version:

4.70 / 1.30.00

Nav. API level:

12


This function will read the value of a date or time field on a received form.

Note that the received form is only valid after a "Form received" event is raised; the event will not be removed until the navFormReceiveDone function is called.

 

Input:

id : DINT (1..2147483647)

ID of the field to read.

 

Output:

linsec : DINT

The value of the field.

For time fields, this is the number of seconds since midnight on 1980-01-01.

 

 

Returns: INT

0

- Success.

-1

- Navigation interface is not open.

-3

- No received form could be found.

-7

- The field could not be found.

 

Declaration:

FUNCTION navFormReceiveReadDateTime : INT;
VAR_INPUT
  id         : DINT;
  linsec     : ACCESS DINT;
END_VAR;

 

Example:

INCLUDE rtcu.inc
 
PROGRAM NavigationExample;
VAR
  date : DINT;
  time : DINT;
END_VAR;
BEGIN
  ...
  // Read the date from field 16
  navFormReceiveReadDateTime(ID := 16, linsec := date);
  // Read the time from field 17
  navFormReceiveReadDateTime(ID := 17, linsec := time);
  // Combine date and time in the date variable.

  date := date + time;
  ...
END;
END_PROGRAM;