Data transmission to the PLC

Vorheriges Oben Nächstes Helps selection copy topic address english version

AccessoriesReadersRFIDi-RDR... (Ex)Reading dataIn SPSPlusWin for SERIES 300Data transmission to the PLC

 

 

To read the data of the RFID card reader into series 200 and 300 devices, proceed as follows:

 

1.Determine which port (COM1 or COM2) is to be used for connecting the card reader.

2.Activate the driver for the "Card reader".

3.Create an analogue variable type "Unassigned Long Integer".

4.Allocate a process connection to the variable which represents the address for the data.

5.Save the variable by clicking on "Ok".

6.Create an analogue variable type "Unassigned Long Integer".

7.Allocate a process connection with the protocol driver of the card reader to the variable.

8.Save the variable by clicking on "Ok".

9.Create a digital variable with operating type "automatic".

10.Allocate a process connection to this variable.

11.Save the variable by clicking on "Ok".

 

ad 1:

-

In the Project Explorer, click on ' Interfaces > COM1 or COM2 '.

The interface parameter dialogue will pop up.

 

Dlg_PartParsRdr

 

Allocate a driver name under "reader".

Under "Device type / Protocol type", select "Card Reader".

 

 

ad 2:

 

Right-click in the Project Explorer under ' Interfaces > COM1 or COM2 '.

Click on "Properties".

The dialogue for the COM port station parameters will pop up.

 

Dlg_StationParsReader

 

Allocate a name (here: "Reader").

Under "Card information", select option "CSN" = ´card serial number or "STAHL" = printed Stahl number (see cicon2 Reading data).

Close this dialogue by clicking on "OK".

 

 

ad 3 & 5:

 

In the Project Explorer, right-click under "Variables" on "Analogue".

In the context menu, click on "New".

The dialogue for creating an analogue variable will pop up.

 

Dlg_ReaderConToPLC

 

Allocate a descriptive name for the variable in this field.

Select operating type "4 automatic".

Specify variable type "Unassigned Long Integer".

Click on "Process connection".

The process connection dialogue will pop up.

 

Dlg_ReaderConToPLC_PCv

 

Under protocol driver, select the driver that has been allocated to the port that establishes the connection to the PLC.

Define the target address on the right side of the screen (this may differ in other connection protocols).

Close this dialogue by clicking on "OK".

 

ad 6 & 8:

 

In the Project Explorer, right-click under "Variables" on "Analogue".

In the context menu, click on "New".

The dialogue for creating an analogue variable will pop up.

 

Dlg_VarRdrDatsToPlc

 

Select operating type "4 automatic".

Specify variable type "Unassigned Long Integer".

Click on "Process connection".

The process connection dialogue will pop up.

 

Dlg_VarRdrDatsToPlcPv

 

Select the protocol driver created in step 1.

Accept the other settings by clicking on "Ok".

 

 

The card reader is sending 3 bits that represent the status:

 

Bit

Meaning

0

Reading process complete, bit exchange will be carried out

1

Card in field

2

Reader error

 

You can use bit 0 to control the transmission of card data to the PLC.

 

You can monitor the bits with three "Digital" variables. For this, proceed as follows:

 

ad 9 & 11 for Bit0:

 

In the Project Explorer, right-click under "Variables" on "Digital".

The dialogue for creating a digital variable will pop up.

 

Dlg_DigVarForStat0_Base

 

Select operating type "4 automatic".

Under "Basic value", activate "Status '0'".

If you want the card data to be transmitted to the PLC, click on "Functions".

The Function dialogue will now pop up.

 

Dlg_DigVarForStat0_Func

 

Click on "Overview".

An overview of the function groups will pop up.

 

Dlg_DigVarForStat0_Func1

 

Under "Copy function", select "Copy analogue variable".

On the "Parameter list" field, click on "Variable (source)".

Under "Parameter type" allocate the variable that was created under 6 & 8.

On the "Parameter list" field, click on "Variable (target)".

Under "Parameter type", allocate the variable that was created under 3 & 5.

 

Dlg_DigVarForStat0_Func2

 

Click on "Process connection".

The process connection dialogue will pop up.

 

Dlg_DigVarForStat0_PvCon

 

Under "Protocol driver", select the driver that you have allocated under 1.

Specify Offset = 0, target bit = 0 and the length = 1.

Select "STATUS" as format.

Close this dialogue by clicking on "OK".

 

Ad 9 & 11 for bit1 and 2:

 

In the Project Explorer, right-click under "Variables" on "Digital".

The dialogue for creating a digital variable will pop up.

 

Dlg_DigVarForStat1_Base

 

Select operating type "4 automatic".

Under "Basic value", activate "Status '0'".

Click on "Process connection".

The process connection dialogue will pop up.

 

Dlg_DigVarForStat1_PvCon

 

Under "Protocol driver", select the driver that you have allocated under 1.

Specify Offset = 0, target bit = 1 and length = 1.

Select "STATUS" as format.

Close this dialogue by clicking on "OK".

 

Repeat these steps for bit2 and, under "Bit" in the process connection, enter 2.

 

 

<< back