07 1 SerialDiscrete PDF

Download as pdf or txt
Download as pdf or txt
You are on page 1of 24

Serial & Discrete I/O

Session 7
Objectives
• The student will correctly identify:
• Which functions to use to read from and write to discrete channels
• Which functions to use to read from and write to a serial port

• The student will correctly implement in a job the WriteDiscrete


function, including proper I/O settings (WriteSerial optional)
as well as an Event function

• The student will correctly explain what Online & Offline mean,
and list the 4 conditions that can affect whether In-Sight is
Online or Offline
7-2
In-Sight I/O Expansion Modules
In-Sight Breakout & Expansion Modules

Outputs
Model Inputs General PoE Serial
High Speed
Purpose
Micro and 5000 0 0 2 N/A Yes *
7000 3 0 4 No Yes
CIO 1400 7 6 2 No Yes
CIO 1450 8 8 2 No Yes
CIO MICRO 8 8 2 Yes Yes
CIO MICRO CC 8 8 2 Yes Yes

* Only TXD/RXD for 5000 series. No on-board serial for Micro.

7-3
Discrete Inputs
Configured under SensorDiscrete I/O SettingsInput Settings

7-4
Loading a Job File

In order to use this functionality you must save job(s) with a numerical prefix
before (or as) the name.
1. Set at least one Input Line’s Signal Type to Job ID Number.
2. The Job ID bit is a binary coded number. Lowest line number is least
significant bit (LSB). Job ID lines must be next to each other. Example -
000 = 0 ; 011 = 3; 101 = 5
3. Select an Input Line to configure and set the Signal Type to Job Load
Switch. The job file that is loaded is indicted by the state (0 or 1) of any
other Input Lines set to Job ID Number at the time of the Load Switch
signal.
7-5
Type of Inputs: User Data
User Data setting is used for reading digital input into
spreadsheet in conjunction with the ReadDiscrete tool
• Event
New reading of input line(s) occurs only when specified event occurs

• Start bit
Number of the first input line to read (0 - 7)

• Number of Bits
Number of lines to read (1 - 8)
7-6
ReadDiscrete Example
Example: Each time an image is acquired, read discrete input line 1

Configure Line 1 as
User Data type

7-7
ReadDiscrete Example
Each time image is acquired, the
ReadDiscrete tool and its
accompanying MultiStatus
(automatically inserted) will change as
follows:

If line 1 is low, ReadDiscrete will


show 0 and the MultiStatus will
show a yellow light

If line 1 is high, ReadDiscrete will


show 1 and the MultiStatus will
show a red light

7-8
Discrete Outputs
Configured under SensorDiscrete I/O SettingsOutput Settings

7-9
Details Dialog
• Depending on the Type chosen the details dialog offers
additional settings Job Completed
Programmed

All Others
Strobe 7-10
Types of Output: Programmed
Programmed setting is used for writing digital output from
spreadsheet by using the WriteDiscrete tool

Activates the WriteDiscrete


First output line number to start writing to
How many bits to use when writing
Decimal integer value (written as binary bits)

WriteDiscrete MultiStatus (auto-inserted)


9 8 7 6 5 4 3 2 1 0

Writing 0

Writing 1
7-11
Serial Port Settings
Configured under SensorSerial Port Settings

Note: The In-Sight Micro


series does not have an
onboard serial port.
7-12
Serial Modes: Text
Text setting is used for writing and reading
ASCII text in conjunction with the ReadSerial
and WriteSerial tools
ReadSerial - receives text string from serial port

WriteSerial - sends out text string to serial port

7-13
Native Mode
Special ASCII commands sent to In-Sight from another
device (computer, PLC, etc.) over a serial or network
line

They can
• Control In-Sight
Ex: Go online; open a job

• Get info from spreadsheet


Ex: return value that’s in cell F12
Note: Commands found in Help File:
• Put info into spreadsheet Communication Reference->
Ex: put a 4 into cell C6 Native Mode Communication
7-14
DeviceNet Mode
DeviceNet: For optional RS232-to-DeviceNet Gateway
adapter which is connected to an In-Sight serial port

Use ReadDeviceNet and WriteDeviceNet


under Input/Output functions

7-15
Motoman, Kuka, and Unused
 Motoman: Protocol for communicating
with Motoman MRC, MRC-II, and XRC robot
controllers operating in DCI mode.
 Kuka: Protocol for communicating with
Kuka KR C2 and KR C2 Edition 2005 robot
controllers.

 Unused: Closes port so no commands or


data can be received/sent

7-16
The Event Function
• The Event function behaves similarly to the AcquireImage and
holds a value of one when activated
• You can choose the trigger that will activate an Event
• All cells that depends on said Event will be updated (independently
of image acquisition)

• For example:
When a pulse occurs on discrete input line 0 the Event
can be used to update those portions of the spreadsheet that
depend on the Event instead of using the image acquisition
cell (A0)

7-17
Other Event Triggers
Conditions
• Discrete Input
• Manual Acquisition Trigger
• Online/Offline state of system
• Job Load Done
• Soft 0-7: Programmable in software

Error conditions
• Acquisition Error (missed Camera Trigger)
• Discrete I/O Error (tracking pulse overrun)
• Serial Port Error

7-18
Online vs. Offline
Online means that all In-Sight I/O
(discrete, serial, network, and
non-manual triggers) is enabled

Offline means that most


In-Sight I/O is disabled

7-19
Online vs. Offline
When ONLINE… When OFFLINE…

You can do this: You can do this:

• Acquisition triggers • Editing of the spreadsheet

• Serial I/O spreadsheet functions • Opening the Formula Editor or Property


Sheets
• Discrete I/O spreadsheet functions
But not this:
• Network I/O spreadsheet functions
• Acquisition triggers
But not this:
• Serial I/O spreadsheet functions
• Editing of the spreadsheet
• Discrete I/O spreadsheet functions
• Opening the Formula Editor or Property
Sheets • Network I/O spreadsheet functions
7-20
Online vs. Offline
Four ways to set In-Sight ONLINE and OFFLINE state:

1. Sensor -> Startup

2. Toolbar

3. Discrete input line configured for offline

4. Native Mode Commands


SO0 = Set Offline
SO1 = Set Online

7-21
Reminder about I/O
• Keep in mind what the I/O needs for write values:

• Discrete – Integer
• Serial – String

• In-Sight must be ONLINE in order to send or receive any I/O

• All settings (serial, discrete, etc.) are system-wide for In-


Sight, i.e., for all subsequent jobs loaded into In-Sight

7-22
Summary
• Serial communications:
• 1 serial I/O port
• Send/receive data with WriteSerial &
ReadSerial, set Mode = Text
• Also used for Native Mode,
DeviceNet, Kuka & MotoMan

• Discrete I/O:
• Additional inputs and outputs,
depending expansion module
• Read state using ReadDiscrete, set
line Type = User Data
• Set state using WriteDiscrete,
set line Type = Programmed

7-23
Summary
• Four ways to go online or offline. If
one way says offline, it overrides
another saying online

• Event functions allow the user to


create custom control options
within a spreadsheet

• Write I/O functions depend on an


event (AcquireImage or Event) in
order to execute and the system
needs to be online.

7-24

You might also like