STUCK... Need help!! SIemens Instance Calls

drip

Member
Join Date
Jan 2009
Location
canada
Posts
59
I have created a program in step7 V5.4, using S7-300 controller, CPU-315-2PN/DP. The routine I created is a printing routine using a ******* devicemaster. I setup the device master to be able to accept outputs in the range 1152-xxxx.

In my routine I have 12 different structures all in the same format the first 2 outputs are 2 bytes each and are words, then there are another 34 output bytes each as char.

I have a counter incrementing so that a different structure is inputted into a instance block for each different count.

The instance block, takes the copied structure and ouputs it to each output address byte by byte.

My problem lies with the structures that are being sent into the instance block. All the structures are of the same format, but for some of them the information is not read and 0's get sent into the instance block for each byte.

The could to send the structures is correctly working, 2 of the structures that were working can be sent all day, I set one strcuture to be sent for every even number and another different one for every odd number, and this works fine I get the information everytime sent to the instance block and out to the outputs.

It seems like the problem is reading from the DB for my main routine which contains the instance data block call and all the structures it like it does not read the correct information.

For some reason I cannot change the information in the strcuture that I am sending out, I changed the initial value and saved it updated the block, go to the DB and it is changed in there, but when I send out that structure it still has the old number.

I have copied the contents of one working structure into a non working structure and I still get 0's.

And this is only for some fo the structures, which again are all the same, but for some reason some are read and some are not.

If someone could please help it would be great I will show a copy screen shots for information.
 
1.jpg
 
The problem lies with the print_code structures getting sent out, the initialize works in every rung to be sent out, but the data and barcode ones do not. I copy the contents from one to another and still the same.

If I change Print_code-string_17 to a 0, the structure will still send out a 1, but the DB says it has been changed as well as the interface.

It is probably something that is little and easy just looking for some out side help. I have been having troubles printing all week and finally have solved my problems one by one until this which seems like the last one.
 
Using Simatic manager create a library. Insert an S7 program into the library. Copy the blocks (excluding system data) from your project to the library blocks folder. Archive the library and post it as an attachment.
 
Here ya go thank for anything you can do,

Your looking at fb155 which is the station the printing is done, that calls fb22 the print handling routine.
 
Maybe I did not save it correctly before I sent it out to you, but they were all updated. I saved everything before downloading to check to make sure and everything was updated. I will try again though.
 
Ok, sorry, but maybe everything did not get updated. That did fix some of the the problems, specifically the chnage in string_17 that I changed from a 1-0 for testing purposes.

I still have prolems with print_code_barcode, everytime I send it out, I get 0's to the output routine for every byte.
 

Similar Topics

Im having a really difficult time with some code that i have to write for a class and the teacher doesnt help much, if anyone can help me that...
Replies
3
Views
1,412
Hi, I am using M221 reading from 3 different sensors (modbus rs485) sharing same bus (daisy chain). I am currently using READ_VAR (in total...
Replies
0
Views
84
I'm using one TON (called SystemTimer) throughout a program that I change the .PRE given different conditions. I'm porting an IDEC ladder over to...
Replies
8
Views
314
We have a keg check weigher that that lost a fight to a forklift. The scale was previously a Systec IT3000, which was the only PROFIBUS slave...
Replies
5
Views
672
really strange issue. The panelview(2711p-T10C22D9P) will try to load an application and get stuck on "Starting Alarms". If I reboot the...
Replies
4
Views
1,433
Back
Top Bottom