Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Format for Time type

Format for Time type 3 years 10 months ago #10630

  • Bruce@Spang
  • Bruce@Spang's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 41
  • Karma: 0
I have a number of time-tagged log entries to read, sort and display (with date/time) from ModbusTCP slaves.
The time from the slaves is POSIX time - but what functions does Proview have to convert this data into its own time format?

What is the Proview representation for time?
The administrator has disabled public write access.

Format for Time type 3 years 10 months ago #10631

  • benoit
  • benoit's Avatar
  • OFFLINE
  • Gold Boarder
  • Posts: 180
  • Thank you received: 1
  • Karma: 0
Hi Bruce,
maybe this link can help you...

www.theseus.fi/bitstream/handle/10024/60...3AD52E1A0?sequence=1

/Ben
The administrator has disabled public write access.

Format for Time type 3 years 10 months ago #10632

  • Bruce@Spang
  • Bruce@Spang's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 41
  • Karma: 0
Thanks Ben -

Not quite my question, though. I caused confusion by saying the source was over Modbus TCP.

The question is for any POSIX time as an integer (a count of seconds since midnight December 31 year 1969), how do I convert to the Proview pwr_tTime type. I don't see any pre-defined conversions, and the Plc _arithm blocks do not offer Time outputs.
The administrator has disabled public write access.

Format for Time type 3 years 10 months ago #10635

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3170
  • Thank you received: 497
  • Karma: 133
Hi Bruce,

The ProviewR time is a struct with two 64-bit words, tv_sec and tv_nsec. tv_sec is the number of seconds since the Unix epoch and tv_nsec nanoseconds. This is identical to the unix time on 64-bit linux, but not on 32-bit linux where the time is two 32-bit words. In your case you can set tv_sec to the received time and tv_nsec to zero.

/Claes
The administrator has disabled public write access.
The following user(s) said Thank You: Bruce@Spang
  • Page:
  • 1
Time to create page: 7.881 seconds