Datasheet

if ( op->ErrorCount == op->ErrorSoftLimit)
errh_Error( "IO Error soft limit reached on card '%s'", cp->Name);
if ( op->ErrorCount >= op->ErrorHardLimit)
{
errh_Error( "IO Error hard limit reached on card '%s', IO stopped", cp-
>Name);
ctx->Node->EmergBreakTrue = 1;
return IO__ERRDEVICE;
}
continue;
}
}
return 1;
}
/* Every method to be exported to the workbench should be registred here. */
pwr_dExport pwr_BindIoMethods(Ssab_Do) = {
pwr_BindIoMethod(IoCardInit),
pwr_BindIoMethod(IoCardClose),
pwr_BindIoMethod(IoCardWrite),
pwr_NullMethod
};
Step by step description
This sections contains an example of how to attach an I/O system to Proview.
The I/O system in the example is USB I/O manufactured by Motion Control. It consists of a card
with 21 channels of different type. The first four channels (A1 – A4) are Digital outputs of relay
type for voltage up to 230 V. The next four channels (A5 – A8) are Digital inputs with
optocouplers. Next eight channels (B1 – B8) can either be configured as digital outputs, digital
inputs or analog inputs. The last 5 channels (C1 – C5) can be digital outputs or inputs, where C4
and C5 also can be configured as analog outputs. In our example, not wanting the code to be too
complex, we lock the configuration to: channel 0-3 Do, 4-7 Di, 8-15 Ai, 16-18 Di and 19-20 Ao.
Attach to a project
In the first example we attach the I/O system to a project. We will create a class volume, and insert
rack and card classes into it. We will write I/O methods for the classes and link them to the plc
program. We create I/O objects i the node hierachy in the root volume, and install the driver for
USB I/O, and start the I/O handling on the process station.
Create classes
Create a class volume
The first step is to create classes for the I/O objects. The classes are defined in class volumes, and
first we have to create a class volume in the project. The class volume first has to registered in the
GlobalVolumeList. We start the administrator with
> pwra
and opens the GlobalVolumeList by activating File/Open/GlobalVolumeList in the menu. We enter