MBX Module
2-196
MBX_pend waits for a message from a mailbox. Its timeout parameter
allows the task to wait until a timeout. A timeout value of SYS_FOREVER
causes the calling task to wait indefinitely for a message. A timeout value
of zero (0) causes MBX_pend to return immediately. MBX_pend’s return
value indicates whether the mailbox was signaled successfully.
MBX_post is used to send a message to a mailbox. The timeout
parameter to MBX_post specifies the amount of time the calling task
waits if the mailbox is full. If a task is waiting at the mailbox, MBX_post
removes the task from the queue and puts it on the ready queue. If no
task is waiting and the mailbox is not full, MBX_post simply deposits the
message and returns.
MBX Manager
Properties
The following global property can be set for the MBX module on the MBX
Manager Properties dialog in the DSP/BIOS Configuration Tool or in a
Tconf script:
❏
Object Memory
. The memory segment that contains the MBX
objects created with Tconf.
Tconf Name: OBJMEMSEG
Type: Reference
Example:
bios.MBX.OBJMEMSEG = prog.get("myMEM");
MBX Object Properties
To create an MBX object in a configuration script, use the following
syntax. The Tconf examples that follow assume the object has been
created as shown here.
var myMbx = bios.MBX.create("myMbx");
The following properties can be set for an MBX object in the MBX Object
Properties dialog of the DSP/BIOS Configuration Tool or in a Tconf script:
❏
comment
. Type a comment to identify this MBX object.
Tconf Name: comment
Type: String
Example:
myMbx.comment = "my MBX";
❏
Message Size
. The size (in MADUs) of the messages this mailbox
can contain.
Tconf Name: messageSize
Type: Int16
Example:
myMbx.messageSize = 1;
❏
Mailbox Length
. The number of messages this mailbox can contain.
Tconf Name: length
Type: Int16
Example:
myMbx.length = 1;
❏
Element memory segment
. The memory segment to contain the
mailbox data buffers.
Tconf Name: elementSeg
Type: Reference
Example:
myMbx.elementSeg = prog.get("myMEM");