Step7 CPU300 question

Hi again PeterW.

I'm trying to understand Your code, and I've got some questions:

1. What does "initialize" mean ?

2. The datas that come from PIW752......are they integer, and
come in 16 bit = word ?

3. In the datablock I must make words like this:
datablock.JPG

.........I only know the option to manually write all the words into the datablock, as You can see I have written (a,b,c and d).......this would take me a decade.......how can I make it smarter. Has It anything to do with this:
STRUCT
+0.0 - Zero - INT - 0
+2.0 - Read_Data - ARRAY[1..8000] - W#16#0
+2.0 - WORD
+16002.0 - END STRUCT

......and where shall I write this, if so ?


4. In my case, where I want to "record and replay" the voltage..........If I buy a big memorycard, can't I then just save the datas on the card, and thereby be able to make recording and replaying with a fast interval over many minutes, maybe an hour, although my cpu has a working memory of 64 kBytes ?


I hope You understand all this nonsens from me :confused:


laura
 
1. By initialise, it means starting point, in the code, before starting the next run, the four block calls puts the value 0 into every voltage reading then the datablock pointer is set to the first of the 4 datablocks and the dataword pointer is set to DW2, the first dataword.

2. As someone mentioned 0 .. 0% and 27648 .. 100%, this is integer, but at the end of the day its only a bit pattern and yes 16 bits. you can scale to whatever you want with maths. for example if you wanted a value 0-100% then (input value/27648*100) would do this for you (you would have to convert from integer to real (floating point) to do this. From your description of your requirements you can store as it is when it comes in.

3. Under Name, replace 'a' with 'stored_data', under Type replace 'WORD' with 'ARRAY[1..8000]' then keep initial value as you have it 'W#16#0'. Once you've entered that the row under it will blue everything out except column Type, in Type place 'WORD'.

This will create 8000 words instantly, you can change the 8000 with whatever value you want, provided the PLC allows that number of words and then the code maximum limit is changed from 8000 to the new number.

4. I'm not sure to tell the truth, maybe someone else would be able to answer, if its RAM maybe, not sure though.
 
ET200S: IM151-CPU7 __ barcode reader

hi, I'm a newbie, my modules is to transfer data from a barcode reader (Dragon 101) to PLc via Serial interface modules of et200s.. I just read the manual..but quite lost now

anyone can help me to give a link to some technical document?
thanks alot
 
cmet said:
hi, I'm a newbie, my modules is to transfer data from a barcode reader (Dragon 101) to PLc via Serial interface modules of et200s.. I just read the manual..but quite lost now

anyone can help me to give a link to some technical document?
thanks alot

I don't know these BCR's, but I think you may find a response if created a new thread with it.
 
Thank You again PeterW.Regarding question 3, this is what happens, when trying to make the datablock:
ffffffffffffffff.JPG


why is this ?

laura

Regarding the other questions, I will write back later.

Thank You very much.
 
It needs a format in that highlighted bit beneath the ARRAY. You have told it to create 8000 data of atype but not told it what type of data.

Write WORD in the space beneath the ARRAY and it will create 8000 words.

It is common to use this technique, it can be any data type (INT, BYTE, REAL, etc) it can also be a UDT, which may in itself contain multiple words.
 
yes, you simply need to enter format of the array items... if you don't know what's available... right click the cell and then select type from menu ...
 
Thanks alot.

PeterW, is it possible, that You will help me "understanding" Your already written code, if I begin with the beginning, and ask alot of questions throughout the whole code ? :oops:
 
laura said:
Thanks alot.

PeterW, is it possible, that You will help me "understanding" Your already written code, if I begin with the beginning, and ask alot of questions throughout the whole code ? :oops:

not a problem
 
Super (y)


1. In the declarations-table there are "IN, OUT, STAT and TEMP). "IN and OUT" are I/O's from the real world, which are binary in-and-out'puts and my PIW752 and PQW752. I understand this.
Sorry, but I don't understand the STAT and TEMP.

2. IS your code made in FB10, and what is the difference between FC's and FB's ?

3. Your coding starts with:

AN #Reset
JC Test // If Reset has not been pushed then jump to main code......where does Your main code start, and how can I see that ?
 
laura said:
1. In the declarations-table there are "IN, OUT, STAT and TEMP). "IN and OUT" are I/O's from the real world, which are binary in-and-out'puts and my PIW752 and PQW752. I understand this.
Sorry, but I don't understand the STAT and TEMP.

TEMP's are present in the declarations of all block types.

These are L (local) flags, that are multi-used. Its quite common in programming to have what is termed as 'scratch' flags, flags that holds the status of some logic that you done to be used within that block. Once you leave the block its status may change by another block.

It basically gives you the opportunity to name a scratch flag at the point you are using it so that you can remember what it is doing in that particular block.

Golden rule with TEMP flags, condition it before you use it.


STAT's are only present in FB's. <== thats the main difference

When you call an FB, you must have an instance datablock (IDB). The program auto creates the IDB and it contains all the INs, OUT,s, IN_OUT's and STAT's.

This means that the STAT's are stored in memory and you can use them to remember status from the last tikme the block was called.

laura said:
2. Your coding starts with:

AN #Reset
JC Test // If Reset has not been pushed then jump to main code......where does Your main code start, and how can I see that ?

I made the assumption that before starting you would want a clean system, so have included the ability os a RESET pushbutton to be installed.

I did not do any other programm, a call would look like

jufb10.JPG


DB90 was created as the IDB and the Inputs and Outputs could be M flags if required and started and monitored in a VTA table.
 
Entering a Multiple Instance in the Variable Declaration Window



  1. Open the function block from which the subordinate function blocks are to be called.
  2. Define a static variable in the variable declaration of the calling function block for each call of a function block for whose instance you do not want to use an instance data block.
    • In the variable table, select hierarchy level "STAT".
    • Enter a name for the FB call in the "Name" column of the variable detail view
    • Enter the function block you want to call in the "Data type" column as an absolute address or with its symbolic name.
    • You can enter any explanations required in the comment column.

Calls in the Code Section



When you have declared multiple instances, you can use FB calls without specifying an instance DB.



Example: If the static variable "Name: Motor_1 , Data type: FB20" is defined, the instance can be called as follows:



Call Motor_1 // Call of FB20 without instance DB
 

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