Can I have explanation about this function block and its parameters (timeout: what is it for, busy: when it will be true and false)?
2 Answers
Well... It's a function block that returns the windows time/date information to your controller.
This looks like it is an asynchronous function block, meaning that you tell it to start, and it takes multiple controller executions to return the results. In the meantime, the busy bit will be true until there is either a fault, or it is successful.
If a fault occurs, the error bit will be set true, and a error ID number will be displayed in the errid field. If the result is returned successfully, the busy bit will be reset with no error feedback.
I'm not familiar with beckhoff programming, but it looks like you specify a timeout. If you don't get a result within the timeout duration, you will get a error.

- 162
- 7
-
I think the busy will still true until timout finished – Ahmad Z. Tibi Jul 30 '14 at 13:52
As mentioned here: http://infosys.beckhoff.com/italiano.php?content=../content/1040/TcPlcLibUtilities/HTML/TcPlcLibUtilities_NT_GetTime.htm&id=
Function block NT_GetTime has an input of NETID, START, TMOUT and output of BUSY, ERR, ERRID, TIMESTR.
NETID is the AmsNetId of the target device. If you're running on local runtime, just put empty string, ie ''
START: the rising edge of this will trigger the function block
TMOUT is the amount of time allocated before the function block gives up on executing the command
After a rising edge of input START, the function block will run and try to connect to the device specified in NETID, and it will try to get the local time of the device. BUSY will become true. If the function block executes well, BUSY will become false, and the local time will be given by the TIMESTR output.
The function block tries to connect with the device specified by the NETID. If there's connection problem, the function block will keep trying to connect with the device for the length of time specified in TMOUT, and BUSY will keep being true. After time specified in TMOUT elapsed and the function block still can't connect to the device, BUSY will become false, ERR will become true, and ERRID will tell you what the problem is (for example, 0x745 is timeout elapsed).
List of error code: http://infosys.beckhoff.com/italiano.php?content=../content/1040/TcAdsCommon/HTML/Ads_ReturnCodes.htm&id=

- 583
- 3
- 11