Step7 CPU300 question

When changing in the Datablocks from "stored_data" to "Read_Data" it is being accepted.

I will return with more questions later.

laura
 
Last edited:
Hi PeterW.


1.What are Your zero words (integer) used for in the datablocks ?


2. In Your code, You call the Standard SFC21 block 4 times, used for Data Store 1, 2, 3 and 4. Is it because You have 4 datablocks.....I assumed You only had the 3 datablocks Data Store 1, 2 and 3 ?


3. Is this a Standard function called, or what is it ? (from Your code):

SET
S #Reset_Done
R #Test_Running
BEU
 
Hi Laura,

To answer your questions.

1. The zero was just to have a known zero to place into the rest of the datablock, it could have been a flag even. By creating it in the DB and giving it a preset of 0, means its already set-up.

2. I created 4 datablocks, really you can create as many as your PLC can hold if you want or as little as you need. You would just need to change the 13 I put in after the jump point 'next' (DB's 10 to 13 in my example) .

3. SET is an instruction that set's the RLO to '1' unconditonally, after that I do two instructions that depend on the state of the RLO. I SET one memory bit 'Reset_Done' and RESET another 'Test_Running' after that I unconditionally leave the block because this was the completion of the RESET function.

The reset function is just to clear all the datablocks so you remove all data from previous tests, not to get them mixed up.
 
Dear PeterW.

Thank You very much for the attached file, with the program in it.

I now can see, how You attach the I/0's from the real world, to the IN and OUT's in the declarationtable. I now also believe I quite understand the program, so that is a good thing.

What I am trying to now, is to have 2 channels (PIW752 and PIW754) recorded and replayed (PQW752 and PQW754), at the same time, instead of the one channel PIW752 and PQW752.

So I have taken a copy of Your program, and am trying to make changes in it, so that I can have these TWO channels working.

I do not need any more I/0's from the real world though, because I want to make the recording and playing of the two channels at the same time........that means, that whenever the cpu reads or writes, it makes it for two channels, and not one channel alone.

Is it possible, to get Your help through this ? :confused: :oops:
 
Not sure why you'd want to read and write at the same time.

Do you still want recorded values to play-back?

If not why use a PLC at all?

Not sure of your application, if you want to write at the same time as read, then all you need is for the input to feed directly to the output. You could even by-pass the the PLC and feed your output device straight to the input device.
 
Peter, I think you have mis-read the previous post - Laura wants to record two channels at the same time and then play back two channels at the same time.
 
SimonGoldsworthy said:
Peter, I think you have mis-read the previous post - Laura wants to record two channels at the same time and then play back two channels at the same time.


Ah! at the same time.... it is early you know :oops:
 
Sorry Laura, now Simon has corrected me, the simplest way would be to call the FB twice in OB35, changing to the new analogues, the only change you'd need to make would be to add a couple of integer declarations, to identify individual Data Block ranges, either as start DB and number of DB's or start DB and end DB.

Also of course the reset would need to be modified similarly.

EDIT: Actually you'd just need an end DB in the FB and the start DB in the reset block.

EDIT#2, time for coffee I think, it is a bit more involved, but not too hard, ask away when you start looking.

For the storing, it needs the end adding only, as the reset would preset your start point.

For the reset, once you have added the end db parameter, the instance DB addresses will change, these will need to be done. The code will then need to be repeated for the second save area, copying, then changing the DB's to the new DB's for the second area.
 
Last edited:

Similar Topics

Hello. I need your help. I work at STEP7. There are two CPU 317-2 PN/DP controllers (317-2EK14-0AB0), working on PROFIBUS, as Master (CPU_1) and...
Replies
2
Views
67
This is the first time I am working with Simatic Manager Step7 as I started my siemens journey with TIA which is pretty easy and do a lot of stuff...
Replies
3
Views
168
When you download a DB, the values get overwritten by what is in the "actual" column in offline DB. Does this happen at the start of the PLC...
Replies
6
Views
157
Hello Inside a FB, I´m trying to transfer a string from a DB to a IN_OUT var that was define as a UDT. The problem is that i can´t determine the...
Replies
4
Views
153
Hi all, I am trying to convert RSLogix 5000 program to Step7. I need to bit shift left my array of double integers for tracking the product on...
Replies
2
Views
533
Back
Top Bottom