ATS AFR Tool End of trail navigation bar

Table of Contents

ATS AFR Tool Simulation

Facilitates simulation of an ATS AFR Tool.

Library

QUARC Applications/ATS

Description

ATS AFR Tool Simulation

The ATS AFR Tool Simulation block facilitates simulation of an ATS AFR Tool. An AFR Tool block can communicate with the ATS AFR Tool Simulation block, passing it position or velocity commands and receiving state information, such as position, velocity and torque data back, as well as sundry status flags.

Input Ports

pos

A 19-element vector containing the actual absolute position of each axis.

vel

A 19-element vector containing the actual velocity of each axis.

trq

A 19-element vector containing the actual torque for each axis.

en

A 19-element vector indicating whether each axis is enabled. A non-zero value means the corresponding axis is enabled. A zero value indicates the axis is disabled.

flt

A 19-element vector indicating whether there has been a fault for an axis. A non-zero value means the corresponding axis has experienced a fault. A zero value indicates the axis is operating normally.

rdy

A 19-element vector indicating whether each axis is ready for a command. A non-zero value means the corresponding axis is ready. A zero value indicates the axis is not ready.

busy

A 19-element vector indicating whether each axis is busy performing a command. A non-zero value means the corresponding axis is still executing the last command. A zero value indicates the axis is not busy. For velocity commands, this flag should always be 1 since the axis continues moving. For position commands, it should go to zero when the position setpoint is reached.

done

A 19-element vector indicating whether each axis is busy performing a command. A non-zero value means the corresponding axis has completed the last command. A zero value indicates the axis is not done. For velocity commands, this flag should never go high. For position commands, it should go high when the position setpoint is reached.

beat

A scalar value representing the heartbeat from the PLC.

Output Ports

mode

A 19-element vector representing the mode of each axis. The valid modes are shown in the table below:

Axis Mode

Description

0

Do not move this axis.

1

Control the velocity of this axis. The velocity setpoint is determined by the vel output. The velocity may be positive or negative.

2

Control the position of this axis. The position setpoint is determined by the pos output. The maximum velocity used to reach the commanded position is determined by the vel output. In this case, the maximum velocity should be positive.

pos

A 19 element vector of position setpoints for each axis that is used in position control mode (axis mode 2). For those axes that are not in position mode, the corresponding element is ignored.

vel

A 19 element vector of velocity setpoints for each axis that is used in velocity control mode (axis mode 1). This vector determines the maximum velocity in position control mode (axis mode 2). For those axes that are not in position or velocity mode, the corresponding element is ignored.

reset

A 19 element vector of reset flags. If any element is non-zero then the corresponding axis is reset.

beat

A boolean value representing the heartbeat from the host PC. This signal can be monitored to determine whether the host is still alive.

new

A boolean value indicating whether the outputs are new since the last execution of the block.

Parameters and Dialog Box

ATS AFR Tool Simulation

URI (tunable offline)

The URI upon which the block listens for client connections. This parameter identifies the communication protocol and associated parameters. If the s7 protocol is used then it acts like a PLC communications processor and it may be possible to interface it to a PLC or HMI, for example. A typical URI in that case would be s7://localhost. The block also communicates with a AFR Tool block in a client model. In that case, other protocols, like tcpip may also be used. For example: tcpip://localhost:18000.

For the s7 protocol, the URI takes the form:

s7://host?nic=a.b.c.d

where the components are as follows:

Component

Description

host

The hostname or IP address of the PLC eg. localhost. The hostname is ignored as the ATS AFR Tool Simulation block is a server.

a.b.c.d

The IP address of a particular network interface card (NIC). In this case, the s7 protocol will listen only on that particular NIC. This option allows multiple simulations to be run, each using a different NIC (since the port is not configurable).

A typical s7 URI is: s7://localhost.

Data block number (tunable offline)

The data block (DB) number of the memory in the PLC the block is simulating.

Sample time

The sample time of the block. A sample time of 0 indicates that the block will be treated as a continuous time block. A positive sample time indicates that the block is a discrete time block with the given sample time.

A sample time of -1 indicates that the block inherits its sample time.

The default sample time is set to qc_get_step_size * ceil(0.020 / qc_get_step_size) which is an expression that returns the closest integer multiple of the fixed step size of the model to 20 ms.

Active during normal simulation (tunable offline)

Indicates whether this block should communicate during normal simulation.

Targets

Target Name

Compatible*

Model Referencing

Comments

QUARC Win32 Target

Yes

Yes

Fully supported, including the s7 protocol.

QUARC Win64 Target

Yes

Yes

Fully supported, including the s7 protocol.

QUARC Linux Nvidia Target

No

No

QUARC Linux QBot Platform Target

No

No

QUARC Linux QCar 2 Target

No

No

QUARC Linux QDrone 2 Target

No

No

QUARC Linux Raspberry Pi 3 Target

No

No

QUARC Linux Raspberry Pi 4 Target

No

No

QUARC Linux RT ARMv7 Target

No

No

QUARC Linux x64 Target

No

No

QUARC Linux DuoVero Target

No

No

QUARC Linux DuoVero 2016 Target

No

No

QUARC Linux Verdex Target

No

No

QUARC QNX x86 Target

No

No

Last fully supported in QUARC 2018.

Rapid Simulation (RSIM) Target

No

No

S-Function Target

No

N/A

Old technology. Use model referencing instead.

Normal simulation

Yes

Yes

Fully supported, including the s7 protocol.

* Compatible means that the block can be compiled for the target.

 

navigation bar