cancel
Showing results for 
Search instead for 
Did you mean: 

Socket agent in PCO 2.2

0 Kudos

Hi to all,

in my scenario  I have this situation.

A scanner reader exposes via TCP/Ip connection the result of a read.

I want get data from the reader and run a  transaction on MII.

I have created on PCo the destination (MII 12.0) the source system (the scanner with Ip address and port) then I created the Agent instance and the notification.

When I runs the Agente Instance all works fine, in the log i don't see anything strange, the connection between PCo and the scanner work fine.

When i try to read a lbel in the LOG of PCo i can see this message:

AI_Socket SocketAgent Scanner1 [10.9.32.166:51236] bytes read: carryover = 0, stream = 26

From my point of view means that the PCo received something but the Notification doesn't start.

The Trigger tab is enabled with type Always, so i suppose that on every change attemps should be notified, in the output tab there isn't a logic, i selecetd the output of the scanner and then I selected the transaction to cal on MII.

If   I test with delivery option, all works fine, but when i run the instance nothing happens.
Could somebody help me?

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

former_member196557
Active Contributor
0 Kudos

Hi Andrea,

In your Socket Agent you defined a Name for the connection.  In your Agent Instance, select the Subscription Items tab, click on Browse, click Browse on the new dialog, expand the Address Root tree and select your connection name, then click Add Selected Items, then click OK.  In the Output Tab or your Agent Instance Notification, select the Output tab, then click on Add expression.  In the dialog that appears, select the Subscription Item drop down list and select your name, then click OK to add it to the Output.  You and also add static string and numeric values to the output tab as well, just click on Add Expression and type in the expression data in the editor, then click OK, then select the output name (defaults to Expression1) and change as required.  anything in the Output of the notification is passed as an XML to the destination.

Also, make sure that you have defined in the Source agent how you want to terminate the data in the socket input, either with a terminator string or a fixed byte length.

Regards, Steve

0 Kudos

Hi Steve, thank's for your response. I followed exactly what you wrote, please take a look at the attached file. I don't see any errors. About the transaction on MII, it write e text file with the input parameter. If i run it from Tab outbound, test denistaion delivery, works fine.

Thanks

Andrea

former_member196557
Active Contributor
0 Kudos

Andrea,

Can you provide a sample fo the incoming data stream from the scanner? 

If there is no '#' (Terminator character in the Source definition) in the data stream the Source agent will not raise a Data Change event to the Agent Instance.

If the scanner output is always the same length, try changing the Souce to use a Length value instead of the # for the terminator.  Otherwise, everything else looks correct.

Regards, Steve

0 Kudos

Thnak you very much Steve, you solved my problem.

I forgot to insert the # in tha configuration.

Now all works fine and i'm able to get data from scanner.

Answers (0)