Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
SYPT PRO User Guide / SYPT PRO User Guide.doc
Скачиваний:
244
Добавлен:
03.03.2016
Размер:
17.32 Mб
Скачать

Wrnet - ctNet Write Command

This function is used to send a write single parameter request to another node on CTNet.

Arguments

Node% - 0 to 255

Destination CTNet node address.

Menu% - 0 to 99

Menu number to write to.

Parm% - 0 to 99

parameter number to write to ( 0-99 )

Value% - Signed 32bit

Data value to write into the destination parameter.

Dpos%

Locates the decimal point in scaled data.

WaitCode%

Number of milliseconds to wait for the confirmation message (must be > 8). Zero for no wait.

Return Values

Status%

The status of the write request.

Notes

  • The value written must be a 32-bit integer. To write a fractional value, eg. 12.33, specify the number of digits after the decimal point in the variable Dpos%. In this case, Value% = 1233 and Dpos% = 2.

  • To write an integer value ignoring the decimal point (i.e. a #INT style parameter write), set Dpos% to -1. E.g. If say parameter #2.11 on destination drive has one decimal point, writing 1233 with Dpos%=-1 will write 123.3, if #2.11 has three decimal places, the value written will be 1.233.

Broadcasting

If the destination node is set to zero, WRNET sends a broadcast message that will be received by all nodes. Since broadcast messages are not replied to, WRNET returns immediately with a value of zero and sets the network status to NET_IDLE (assuming the message could be sent successfully).

This command has two modes of operation:

  • Request is sent without waiting for any confirmation from target drive

  • Request is sent and command waits for confirmation from target drive

The WaitCode% argument defines which mode is used:

Notes:

For a WaitCode% value > 0:

  • This form of the command should only be used in INITIAL or BACKGROUND tasks since it halts the task until a response or timeout has occurred.

  • No further WRNET commands can be issued until a reply has been obtained or a timeout has occurred.

Example

Target/ Language Restrictions

None.

________________________________________________________________________________

Wrnetb - ctNet Block Parameter Write Command

This function is used to send a BLOCK WRITE parameter request to another node on CTNet.

Arguments

Node% - 0 to 255

Destination CTNet node address.

Pars%

Array of parameters to write to.

Val% - Signed 32bit

Arrays of values to write.

Dpos%

Array which locates the decimal point in scaled data.

Res%

Array in which to receive replies.

NPars% - 1 to 10

Number of parameters to write.

WaitCode%

Number of milliseconds to wait for the confirmation message (must be > 8). Zero for no wait.

Return Values

Status%

The status of the write request

Note:

Status% will indicate that a message was successful if a response is received. This does not necessarily mean that all parameter writes were successful. The Res% array must be checked to see the status code returned for each parameter write requested.

Notes

  • The values written must be 32-bit integers. To write a fractional value, eg. 12.33, specify the number of digits after the decimal point in the variable array Dpos%. In this case, Value%[2] = 1233 and Dpos%[2] = 2.

  • To write an integer value ignoring the decimal point (i.e. a #INT style parameter write), set the appropriate Dpos% element to -1. E.g. If say parameter #2.11 on destination drive has one decimal point, writing 1233 with Dpos%[n]=-1 will write 123.3, if #2.11 has three decimal places, the value written will be 1.233.

Note:

Broadcast WRNETB must not be used if the CTNet network contains UD75 or MD29AN nodes. These devices respond (incorrectly) to a broadcast WRNETB message, and this will cause problems for subsequent non-cyclic message commands.

This command has two modes of operation:

  • Request is sent without waiting for any confirmation from target drive

  • Request is sent and command waits for confirmation from target drive

The WaitCode% argument defines which mode is used:

Notes

For a WaitCode% value > 0:

  • This form of the command should only be used in INITIAL or BACKGROUND tasks since it halts the task until a response or timeout has occurred.

  • No further WRNETB commands can be issued until a reply has been obtained or a timeout has occurred.

Target/ Language Restrictions

UD75, MD29AN and SM-Applications all support block access, but the CTNet I/O must be fitted with v1.03.00 firmware or later to support block access.

________________________________________________________________________________