gclib examples  0
Example Projects for the Communications API for Galil controllers and PLCs
message_example.cpp File Reference
#include "examples.h"
#include <iostream>

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 Main function for Message Example. More...
 

Detailed Description

See message() for implementation of logic

Concepts

This example demonstrates:

  • How to connect to a controller via IP Address.
  • How to issue basic commands.
  • How to reconstitute a full message from GMessage().
  • How to detect differences in crashed DMC code and Trace.
  • How to print messages.
  • How to use Keep Alive to maintain connection to gcaps.

Prerequisites

A Galil controller with a motor connected at the A axis is needed for this example.

Example Output

`************************************************************************`
Example GMessage() usage
`************************************************************************`
<HELLO WORLD
>
Trace Line: 0 i=0
Trace Line: 1 #A
Trace Line: 2 MGi
Standard Line: 0.0000
Trace Line: 3 i=i+1
Trace Line: 4 WT100
Trace Line: 5 JP#A,i<1
Trace Line: 6 i=i/0
Crashed Code: ?6 i=i/0

Definition in file message_example.cpp.