Examples | Shop
 
Communicating with an OOPic-R, using SCP, over an Ethernet LAN
 
This example application demonstrates how simple communication from your PC over an Ethernet LAN to an OOPic-R using SCP (Serial Control Protocol) is using the Charon I Development Kit.
Carry out the instructions in the ‘Virtual Serial Port using Charon I Development Kit’ documentation, to the point where we are ready to connect the OOPic-R to the Charon.
We are now going to bridge over to the OOPic Microcontroller. OOPic firmware versions 2.2+ can communicate serially using its Serial Control Protocol (SCP). This allows quick and effective serial communication too and from the micro.
To demonstrate the use of COM 10 in this example, we shall initiate a single step sequence within the OOPic code.
Program the OOPic-R using this simple code:
'*************************************************
'*************************************************
'This example program is used to demonstrate the Serial
'Control Protocol (SCP) Single Step command
‘with the OOPic-R and the Charon Module'
'Compiler Version : 5.0.1 OOPic-R
'Written By: Total Robots 'TR-020
'*************************************************
'*************************************************
Dim Red_Led As New oDio1
Dim Yellow_Led As New oDio1
Dim Green_Led As New oDio1
'*************************************************
Sub Main()
Red_Led.IOLine = 8
Yellow_Led.IOLine = 6
Green_Led.IOLine = 7
Red_Led.Direction = cvOutput
Yellow_Led.Direction = cvOutput
Green_Led.Direction = cvOutput
Do
Red_Led.Value = 1
Yellow_Led.Value = 1
Red_Led.Value = 0
Yellow_Led.Value = 0
Green_Led.Value = 1
Green_Led.Value = 0
Yellow_Led.Value = 1
Yellow_Led.Value = 0
Red_Led.Value = 1
Loop
End Sub
'*************************************************
'*************************************************
 
When using the OOPic-R, a null modem Male-to-Male DB9 serial cable is needed, the OOPic-R programming cable will not work!
We can now remove the serial cable from the Charon and replace it with the Null Modem which in turn is connected to the OOPic-R as all communication between the Charon and your PC will now be undertaken via the Ethernet cable, which should now be connected to the Charon module.
Power up the Charon and OOPic-R. All the LED’s will appear to be constantly on. In actual fact they are turning on and off very fast.
In the Hyper10 terminal, type in the SCP override command “\0V”. If the OOPic-R receives the command, it will return a “v” which will be present on the terminal. The OOPic is now in SCP mode.
Type “0J”, you will receive a “j”.
Now type “P” instructing the OOPic to turn on single step and execute one instruction. You will receive a confirmation ”p”. Continue to send “P” and receive “p” and watch the LED’s turn on one by one.
This is a very simple example but it means you can program the OOPic, and have full control of it using SCP over a network! Imagine controlling your OOPic using SCP anywhere in the world!
 

Examples | Shop