WriteDiscrete
Writes a range of bits to a discrete output channel.
Note:
- This function is enabled only when the vision system is Online.
- Jobs that contain this function and saved in In-Sight Explorer 3.3.0 or higher are only compatible with In-Sight Explorer 3.3.0 and higher.
- If an In-Sight Explorer job file containing a WriteDiscrete function is loaded on an In-Sight vision system and the CIO-1400 I/O Module is then connected, the Start Bit and Number of Bits parameters in WriteDiscrete must be changed to reflect the new configuration of the I/O lines.
- In job deployment environments where In-Sight Explorer or the VisionView application are monitoring inspections, if the job depends on a Soft Event (e.g., configured as a Timer function) to trigger a spreadsheet event, it may cause the inspection of an image to be delayed if it is triggered shortly before the acquisition cycle completes. If the job file is large (i.e., it contains many Vision Tools, such as Pattern Match, Flaw Detection or InspectEdge tools, in addition to other job logic), the update required by In-Sight Explorer or VisionView may prevent an image from being inspected until the display update is queued. For applications that require exact timing (e.g., measured in the 10s of milliseconds), this update might delay the determination of pass/fail results and the transmission of results to the next station (e.g., a PLC or motion controller) in the inspection process. To avoid delayed inspections in these application environments, Cognex recommends Soft Events not be used.
WriteDiscrete Inputs
Syntax: WriteDiscrete(Event,Start Bit,Number of Bits,Value)
Parameter | Description |
---|---|
Specifies the event that forces an update.This parameter must be a reference to one of the following:
Note: When the default
Event reference is deleted, the value is replaced by a checkbox. If another
cell is referenced as an event, the function will conditionally run based
on the referenced cell. If the checkbox is enabled, the function will
always run when any inputs to the function are updated. |
|
Specifies the first bit of the set to be written.
|
|
Specifies the number of bits in the set to be written.
|
|
Specifies the positive integer value to be written.
|
WriteDiscrete Outputs
Returns |
The value written, #ERR for any invalid input parameter. |