ACI Reference
9.1
Overview
The AGVS Control Interface (ACI) is an interface that allows a Host computer to give orders to and
collect information from an AGV system.
The ACI software is resident in the software of the System Managers, which makes it possible to
easily subordinate the AGV system to any customer selected Host computer.
The division of the tasks between the Host and the Master can vary in different systems, depend-
ing on to what extent the Host is involved in the details of the material flow in the system.
The Master has the following responsibilities:
l Accept transport requests.
l Maintain an order queue for the transport requests.
l Allocate vehicles to the different transports requests.
l Handle the transport sequence.
l Request for parameters when needed.
l Respond to parameter contents requests.
The AGVS Control Interface gives the Host the following possibilities:
l Start an order in the Master.
l Delete an order in the Master.
l Check status of an order.
l Delete and update parameters in the Master Order Manager.
l Release blocking for lost vehicles.
l Cancel a vehicle
9.2
OM Messages
To make it possible to divide tasks between the Master Controller and a Host computer a number
of messages must be exchanged between these units. The messages are described below.
9.3
Order Initiate Message – q
To start an order from the Host, an order initiate message is sent to the Stationary system. The
message can be of two formats, see (a) and (b) below. 99 priority levels for the orders are also sup-
ported.
System Manager Order Manager | 9 ACI Reference
251 | www.kollmorgen.com/agv
The message format (b) makes it possible for the Master to recognise identical ‘q-messages’, and
ignore them, for example when the Host has resent a message because of no received answer
from the Master (the message was set in a queue). By giving each ‘q-message’ an individual ‘ikey’
parameter the Master ignores multiple messages, as only messages with a unique ‘ikey’ are
allowed in the order queue.
Message:
(a):
q , trp str, [ pri, [p0 [p31] ] ]
(b):
q , trp str, [ pri, code, ikey, [p0
[p31] ] ]
q
Message
type
Description
trp str
1–255
Transport structure. Specifies the transport structure to be star-
ted.
pri
format (a):
00no01–63 (99) has the highest priority
format (b):
81–E3 (227) has the highest priority
code
0-0001
”ikey” value included, format (b)
0004
Start order in Debug mode
ikey
0
Use format (b) without the ‘ikey’ function, which might cause mul-
tiple orders from the same ‘q’ message.
1–FFFF
Parameter values. Up to 32 values can be given. They will be placed
in the first entries in the parameter area
Format (a):
System Manager Order Manager | 9 ACI Reference
| 252
Format (b):
9.4
Order Acknowledge Message – b
This message is sent at eight different occasions:
I. as a response on the order start (‘q-message’)
II. as an acknowledge to a delete order (‘n-message’)
III. as an acknowledge to a parameter update (‘m-message’)
IV. when an order is finished
V. when specified in the transport structure
VI. to indicate a fatal error in an order
VII. as an acknowledge to a change order instance priority (‘m-message’)
VIII. as statistic information of carrier / order connection events
System Manager Order Manager | 9 ACI Reference
253 |
Also the ‘b-message’ has two different formats, (a) and (b), depending on which ‘q-message’
format that is used.
Message:
(a):
b , index, trp str, status, par no
(b):
b , index, trp str, status, par no, spare, ikey
b
Message
type
Description
Index
0–MAXORD
Index in the order queue of the Master
FFFF(hex)
When parameters in the input message, to which the ‘b-message’ is
the answer, is invalid. Further information about the erroneous
parameters is given by the value of the status parameter.
Trp str
1–255
Transport structure. Corresponds to the transport structure on
which the order works.
0
When parameters in the input message, to which the ‘b-message’ is
the answer, is invalid.
Status
see specification on next page.
Par no 0–31
Index for the first parameter being updated, if applicable.
FF (hex)
If no parameter is involved it has the value FF.
Spare
0
Spare parameter to be used in message format (b).
Ikey
1–18
NAK
invalid index
22 /7FFF
Message magic returned in the response message. This can be
used by HOST programmer to connect a status request with a
received status message.
sp
0
Spare parameter.
Itemc
0 – 5
Item code to select requested order status.
Item
Format
Function
0
a
Numerical interval
1
b
External triggers
2
c
Internal triggers
3
a
Used indexes
4
d
Carrier number list
5
d
Priority orders
6
d
Order state
itemo
0 – FFFF
Number of items requested from an item group.
lpflg
FFFFFFFF
Local parameter flags, used for requesting local parameters to the requested order. Each bit in
the long word represents one local parameter. Setting bit 0 requests local parameter 0 in the
response message. Setting bit 31 requests local parameter 31 in the response. Local parameters
are returned in the standard ‘w-message’.
itemt
4 – 5
Item type code. This type code is individual for each item code.
Itemc
Itemt
Function
4
1–8
Selected carrier type
– 1
All carrier types
5
1–99
Selected order priority
– 1
All order priorities
6
1–17
Selected order priority
ut
Unit type.
Defines which unit types that should be selected in the order poll question. The following types are
defined so far:
IO
IO unit type
0
Requester (myself)
2
DEBUG
3
ACI unit (HOST)
4
CWay
MULTD line (OKB)
lline
Logical line.
This is the logical line number.
lunit
This parameter is only valid for multidrop lines and defines the ID number of the requested unit.
module
Internal trigger module from the Master Controller itself. Valid internal modules are:
33
CM
CarWash, CarCharge orders
System Manager Order Manager | 9 ACI Reference
261 |
2F
OM
Sfork started orders
mtype
(Not used)
Format:
System Manager Order Manager | 9 ACI Reference
| 262
Message sequence:
System Manager Order Manager | 9 ACI Reference
263 |
9.7
Order Status Message – s (limited)
This limited ‘s-message’ is the answer from the Master to an order status request of type limited
‘j-message’ from the Host computer. It contains the status of an order in the order queue.
The ‘s-message’ can also be sent spontaneously to the Host computer, if so defined in a transport
structure.
Message:
s, index, trp str, order status, magic, magic_2, car no, spare, car stat,
car stn,
[ [ magic_3] [no_of_lp, lp[0] …. lp[n] ] ] 1.
s
Message
type
Description
index
0–MAXORD
Index in the order queue of the Master.
FFFF (hex)
Filler value when the index value is not valid in the ‘s-message’.
trp str
1–255
Transport structure.
Corresponds to the transport structure number in the Master.
0
Filler value when the transport structure value is not valid in the ‘s-
message’.
order status
Defines the status of the order. An order can be in several dif-
ferent states but most of them are only transitory.
1
not used
System Manager Order Manager | 9 ACI Reference
| 264
s
Message
type
Description
2
pending, waiting for a parameter, input etc.
3
Transitory
4
Transitory
5
waiting for a vehicle
6
Transitory
7
move vehicle
FF (hex)
Filler value when the order status value is not valid in the ‘s-mes-
sage’.
magic
15 bits value, user defined
FFFF (hex)
Filler value when the magic value is not valid in the ‘s-message’.
magic_2
15 bits value, user defined
FFFF (hex)
Filler value when the magic_2 value is not valid in the ‘s-message’.
car no
1–255
Carrier number, vehicle identity.
0
Filler value when the carrier number is not valid in the ‘s-message’
spare
Spare parameter in message, set to 0.
car stat
0000–FFFF
Filler value when the carrier status value is not valid in the ‘s-mes-
sage’.
car stn
Current destination of the carrier
0
Filler value when no carrier is connected.
magic_3
15 bits value, user defined. Omitted if not defined in the Tx_s mes-
sage instruction.
no_of_lp1
0-31
Number of local parameters to follow. 1
Lp[0 … n]1
0-FFFF. Note that 7FFF
Message magic copied from the request message. This can be used
by HOST programmer to connect a received status message with
status request.
sp1
0
Spare parameter.
itemc
0 − 5
Item code copied from the request message.
System Manager Order Manager | 9 ACI Reference
| 266
Item
Function
0
Numerical interval
1
External triggers
2
Internal triggers
3
Used indexes
4
Carrier number list
5
Priority orders
6
Order state
7F
End of message stream
81
Invalid item
83
This unit has one request pending
FFFFFFFF
Order start time. Calculated as Unix 1970 seconds ‘tick’.
strp
1–255
Transport structure, used for starting this order.
trp
1–255
Current transport structure for this order.
row
1–255
Current transport structure row for this order.
olist
1–10
Order list monitor.
1
Free instance
2
Pending list
3
Active list
4
Carrier move request list
System Manager Order Manager | 9 ACI Reference
267 |
5
Carrier request list
6
Carrier release list
7
Carrier move list
8
Calloc request list
9
CM commands list
10
OM debug list
ostate
0–255
Current state for this order.
0
Empty instance
1
Function evaluated
2
Function not evaluated
3
4
Pending parameter request
5
Delayed
6
Break evaluation
7
Terminate order
8
Cancelled
9
Cancel termination
10
Retry
11
Input poll request
12
System function request
13
Explicit parameter request
14
PLC request
15
Bar Code request
16
Evaluated by debugger
17
Waiting for a queue
18
Waiting for ‘child’ termination
Note! For ‘ostate’ = 0 no other order related parameters are valid.
ostatus
0–255
Current status for this order.
0
TRUE
1
FALSE
2
ERROR
opri
0–8
Order priority
trig
0–255
Order trigger.
0
INTERNAL TRIGGER
2
External trigger , DEBUG
3
-"-
, ACI
System Manager Order Manager | 9 ACI Reference
| 268
4
-"-
, CWay
11
-"-
, MULTD
trig_p0
0–255
Order trigger parameter 0.
For trigger = = 0 –> ID of starter process.
For trigger ≠ 0 –> logical line for trigger.
trig_p1
0–255
Order trigger parameter 1.
For trigger = = 0 –> starter parameter.
For trigger ≠ 0 –> in MULTD case this is the unit ID on the multidrop
line.
cid
0–255
Carrier ID for allocated or connected carrier.
Note! For cid == 0 no other carrier related parameters are valid
main stat
0–7
Carrier Manager Main status.
0
Cancelled
1
Cancelled, order connection
2
Free
3
Allocated to order
4
Active
5
Connected to order
6
Unknown for system
cstatus
0–FFFFPLCStatusforcurrentallocatedorconnectedcarrier.movestate0–7FF.
p0–p4 val
0–FFFFValuoflocalparFFFF. Note that 7FFF
Message magic, echoed back in the response message.
code
1–2
Access function:
1
Read global parameters.
2
Write global parameters.
par_num
1–16
Number of parameters to access.
par_ix
0 - 10000
Global parameter number in message position p0.
p0 – p15
Global parameter values to write. Note! Only used when writing (=
code 2).
System Manager Order Manager | 9 ACI Reference
277 | www.kollmorgen.com/agv
See Global Parameter Status - p, page 279 for the response message.
System Manager Order Manager | 9 ACI Reference
| 278
9.14
Global Parameter Status - p
This message is used as a response message to the global parameter command message (‘g-mes-
sage’). The ‘p-message’ is used both for read and write access response.
Message:
p, magic, code, par_num, par_ix, [p0, [p1, [ [ [… p15] ] ]
p
Message
type
Description
magic
0–E000 + (LUnit of the ACI line). In most cases that is E001.ItisalsopossibleformagictobeE000, in which case the reply is sent to all Host units.
To be able to identify a reply to a request, the parameter s3 could be used in multi byte transfer.
9.15.4
OM to PLC Message, Type ‘>’
Function:
Messages from the System Manager, or Host, to the AGV, used for
both read and write command. It is possible to do one or two word
read/write operations in the same message, format (a). It is also
possible to do multi byte transfer, format (b).
Tx:
System Manager or Host to AGV.
Format:
a) '>', res(1), carid(1), magic(2), c1(1), s1(1), om1(1), plc1(1),
par1(2), [c2(1), s2(1), om2(1), plc2(1), par2(2)]
b) '>', res(1), carid(1), magic(2), c(1), s3(1), plc(2), num(1),
sp(1), [ byte1, byte2, ...byte80 ]
Parameters:
a)
System Manager Order Manager | 9 ACI Reference
281 | www.kollmorgen.com/agv
'>'
3Emessagetype,res00−07reserveFFFF
E000−E00F
8A00−8A0F
message magic.
For ACI.
For Cway Custom.
c1
00-FFFF
parameter 1 for write, in case
read the value is not defined.
c2
00-FFFF
parameter 2 for write, in case
read the value is not defined.
b) Multi byte transfer.
'>'
3Emessagetype,res00−07reserveFFFF
E000−E00F
8A00−8A0F
message magic.
For ACI.
For Cway Custom.
System Manager Order Manager | 9 ACI Reference
| 282
c
00-FFcodeformultibyte.05readmultibyteFF
save 3, will be included in reply.
plc
00-239
byte offset in PLC block for first
byte in this message.
num
1-240
total number of bytes to read.
1-80
total number of bytes to write.
sp
0
spare.
bytex
00-3C
message type,
res
00-07
reserved.
carid
1-MAXCAR
carrier id.
magic
1-FFFFE000-E00F8A00 - 8A0Fmessagemagic.ForFF
code for parameter 1.
1
ACK read parameter 1.
2
ACK write parameter 1.
3
NAK read parameter 1.
4
ACK write parameter 1.
s1
00
save 1, copied from request mes-
sage.
om1
00-31
parameter offset from OM for
parameter 2, copied from
request message.
plc1
00-119
parameter offset in PLC block for
parameter 1.
par1
0000-FFFFparameter1readreply.c200−FF
code for parameter 2.
1
OM: ACK read parameter 2.
2
OM: ACK write parameter 2.
3
OM: NAK read parameter 2.
4
OM: ACK write parameter 2.
s2
00
save 2, copied from request mes-
sage.
om2
00-31
parameter offset from OM for
parameter 2, copied from
request message.
plc2
00-119
parameter offset in PLC block for
parameter 2.
par2
0000-FFFFparameter2readreply.b)Mult3C
message type,
res
00-07
reserved.
carid
1-MAXCAR
carrier id.
magic
1-FFFFE000-E00F8A00 - 8A0FmessFF
code for multi byte.
5
ACK read multi byte.
6
ACK write multi byte.
7
NAK read multi byte.
8
NAK write multi byte.
s3
00-FF
value in read multi byte reply.
帮我根据这个用rust语言和Dioxus来构建一个小程序,界面要美观,参数可视化,订单可以用列表显示出来,服务器连接也是,每个参数可以备注修改,要有一个消息列表,每个消息都一个发送,接收的消息可以实时显示
Certainly! Let's work on building a small application using Rust and Dioxus that meets your requirements. We'll create an application that:
Has an aesthetically pleasing interface.
Visualizes and allows modification of parameters with annotations.
Displays orders and server connections in lists.
Manages a message list where messages can be sent and received messages are displayed in real-time.
Here's a step-by-step guide to help you build this application.
Prerequisites
Before we start, ensure you have the following installed:
Dioxus CLI: Install using cargo install dioxus-cli.
Project Setup
Create a New Dioxus Project
Use the Dioxus CLI to create a new project:
dioxus new agv_control_interface
cd agv_control_interface
Project Structure
The project will have the following structure:
src/
main.rs // Entry point
components/
parameters.rs // Parameter visualization and modification
orders.rs // Order list display
connections.rs // Server connections list
messages.rs // Message list and communication
utils/
api.rs // Communication with the server
Implementing the Interface
1. Main Application (main.rs)
use dioxus::prelude::*;
mod components;
use components::{Parameters, Orders, Connections, Messages};
fn main() {
dioxus::desktop::launch(app);
}
fn app(cx: Scope) -> Element {
cx.render(rsx!(
style { [include_str!("./styles.css")] }
div { class: "container",
h1 { "AGV Control Interface" }
div { class: "content",
Parameters {}
Orders {}
Connections {}
Messages {}
}
}
))
}
Styles: Create a styles.css file to define the aesthetics of your application.
Functionality: Displays a list of server connections.
Interactivity: You can add connect/disconnect buttons and status indicators.
5. Messages Component (components/messages.rs)
use dioxus::prelude::*;
use futures::StreamExt;
use tokio::sync::mpsc::{UnboundedSender, UnboundedReceiver};
use std::sync::{Arc, Mutex};
#[derive(Clone)]
struct Message {
content: String,
sender: String,
}
#[allow(non_snake_case)]
pub fn Messages(cx: Scope) -> Element {
let (tx, rx) = use_coroutine(&cx, |mut rx: UnboundedReceiver<String>| async move {
while let Some(msg) = rx.next().await {
println!("Received message: {}", msg); // Handle incoming messages
}
});
let messages = use_state(&cx, || vec![
// Sample messages
Message { content: "System initialized.".into(), sender: "System".into() },
]);
let new_message = use_state(&cx, || "".to_string());
cx.render(rsx!(
div { class: "messages",
h2 { "Messages" }
ul {
messages.get().iter().map(|msg| rsx!(
li { "[{msg.sender}] {msg.content}" }
))
}
input {
value: "{new_message}",
oninput: move |e| {
new_message.set(e.value.clone());
}
}
button {
"Send",
onclick: move |_| {
let msg = Message {
content: new_message.get().clone(),
sender: "User".into(),
};
messages.modify(|msgs| msgs.push(msg));
new_message.set("".into());
// Send message to server or processing unit
tx.unbounded_send("...".into()).unwrap();
}
}
}
))
}
Functionality: Displays a list of messages, allows sending messages.
Real-time Updates: Uses a coroutine to handle incoming messages asynchronously.
Communication with the Server
To handle real-time message updates and server communication, you can use asynchronous tasks and websockets.
1. Asynchronous Communication
Tokio: Use the Tokio runtime for asynchronous tasks.
Futures: Handle streams of data asynchronously.
2. WebSocket Connection
To establish a real-time connection with the server:
use tokio_tungstenite::connect_async;
use futures::SinkExt;
async fn connect_to_server() -> WebSocketStream<MaybeTlsStream<TcpStream>> {
let url = "ws://your_server_address";
let (ws_stream, _) = connect_async(url).await.expect("Failed to connect");
ws_stream
}
Receiving Messages: Use StreamExt to listen for incoming messages and update the UI.
Sending Messages: Use SinkExt to send messages to the server.
3. Integrate with Dioxus
Use cx.spawn to run asynchronous tasks within Dioxus components.
Update state using set or modify methods provided by use_state.
Styling the Application
Create a styles.css file to enhance the aesthetics of your application.