IM151-8 Serial Problems

hein123

Member
Join Date
Aug 2010
Location
Uitenhage
Posts
93
Please help, I am pulling my hair out .


I have a IM151-8 PN/DP CPU PLC with a few Serial Com cards (
clip_image002.gif
ET200S 1SI ) for reading barcodes.


Firstly I want to know if this is possible.


Because all barcodes work similar, I wanted to use a FC and within the FC I use the S_Send and S_Rcv FB’s which each have its own instance DB. Basically when I send a start signal, it send a start signal and then read the barcode, pretty straight forward and when I do this on its own all is good.



I use indirect accessing inside with the FB, but this is working. The problem comes when I add the S_SEND FB or S_RCV FB. It firstly gives me an ‘STOP caused when allocating local data’ fault and sometimes a FB not loaded. I have about 40% memory left on the device.


When I use just working FB from my test within the ‘pull my hair out FB’ it still gives the fault, without using indirect addressing.


Please, any advice would be greatly appreciated
 
Hi Hein

Could you upload an archive of the two FB's, so we can have a look at them.
I would not use a FC for this function, will use a FB.
 
I firstly want to get the functionality of the rest of the program working first and then play with this again as this project has to be finished by monday.

Why would you use an FB instead of a FC, is an FB better as the way I see it it uses more memory.

Basically my goal is to creaty a library for all the normal stuff we use to reduce programming time, is it better to use FB's?

Could you maybe give me a link so that I can read up on this
 
An FB does not necessarily use more memory, as the calling parameter exchange is different than for an FC.
Simplified; in an FB call, the compiler uses A/= and L/T, while in an FC call the exchange goes via pointers that each are 6 bytes and requires several L/T transactions.

To find more info, check SIEMENS/Documentation/Afrikaan(?)/STEP7-Programming With Step7 and /STEP7-Working With Step7.
icon12.gif


Check chapter 10 in both manuals, focus on 'multiple instances'.

Kalle
 
Thanks, I got it to work. I used an FB as well as made a few changes.

1 scanner works now, hope the rest have a similar result
 
New day, new problems :)
An FB would not work with this as within it I use FB's supplied by Siemens to read and write to the serial devices.

At least I learned a few things with this procedure I used, which will always help for future program.

However, I have another issue that has risen.

With the serial card I use, ET200S 1SI, it sometime just stop reading/writing signals and I can find no way how to reset the device except by reseting the power and I know this is not the solution.


 
A FB works fine for t the reading of serial data.
You add the FB for reading the data (S_RCV) as an instance to the STAT of the FB.
Then you can use the FB as a multiple instance to ectivate as many scanners as possible.

As for your new problem are you monitoring the rcv error to ensure that you are not getting errors during the read process?
 

Similar Topics

Hi In one of our machine, there is Seimens PLC IM151-8 PN/Dp CPU. HMI is connected via Ethernet and other devices are connected via Profibus...
Replies
5
Views
3,156
Hi guys, I have IM151-8 Siemens PLC, i want to connect it with Modbus and read/write on it using Modbus protocol. How can i do this? Do i need...
Replies
4
Views
2,586
Hi All, I am building a Profibus network using a Mitsubishi QJ71PB92D Profibus Master Module. Current Setup: - 1- Profibus Master (Resistor On)...
Replies
13
Views
2,659
We have these in our shuttles. The IP Address is stored on the SD card for the unit. We had a card go bad and I am trying to copy another card...
Replies
3
Views
1,170
Hi all, i want to make a TCP connection to an "other station" in Simatic Manager to be able to send commands to an external device. I wanted to...
Replies
6
Views
1,969
Back
Top Bottom