S7-200 Micro/Win DataBlock question

micgent

Member
Join Date
Aug 2009
Location
Gateshead
Posts
52
Hi
I wish to write a programme that outputs one of several preset analogue outputs selected by input switches.

Im not sure how to configure the preset analogue values.
I think I need to create a DataBlock
assign data to memory locations but not sure what syntax.
eg M0.0 = 256

then use MOV M0.0 to AQ1 BIT such and such

can anyone help?

thanks
MG
 
Hi MG,

Not sure how many presets you are wanting to move but you may not need a datablock.

You can use a normal move [MOV_W] to achieve the same thing...

Hope this helps.

Rob

Microwin1.jpg
 
Thanks for the quick reply,
as usual im trying to complicate matters.
I understand your advice, will give it a go cheers.

mg
 
Hi MG,

Not sure how many presets you are wanting to move but you may not need a datablock.

You can use a normal move [MOV_W] to achieve the same thing...

Hope this helps.

Rob


I wish to use 24 preset values. Which are values i wish to pass to the analogue output.
But the chosen value is dependant on two seperate sets of input combinations. This equates to a 8x3 table.
 
This is to address an overall view of your situation, specifically the 200's lack of a battery backup. If you install a battery module, fine. If not you should treat data as not being retentive for more than 48 hours. I'm not quoting specs, just a cautious time period.

There are four ways I can think to handle it:
1. Use constants for your move statements instead of VW memory that may not be maintained
2. Install a battery module
3. Use PLC code to detect a change in setpoint (change in the VW memory) and write it to EEPROM
4. At the conclusion of your startup when all VW areas have been set with the values you want to keep, put the PLC in stop mode. Then create data block from RAM.

The data block values will be used by the 200 CPU if it suffers a power loss (without a battery) long enough (think 48 hours, could be a week) to lose its RAM. When you create a data block from RAM you want to use values that are safe for your process. If you don't specifically create a data block from RAM there is not one. Unless you did it manually offline and then loaded it.

Use at least one of the four steps above.

Hope this helps.
 
I hope I did not confuse you. With the 200 you don't need to create a data block like you would with a 300. Follow Kidblue's suggestion and use VW100, VW102, etc for your values. Get the process running. Then go back to what I said about preserving the data through a power loss greater than 48 hours. ;)
 
I hope I did not confuse you. With the 200 you don't need to create a data block like you would with a 300. Follow Kidblue's suggestion and use VW100, VW102, etc for your values. Get the process running. Then go back to what I said about preserving the data through a power loss greater than 48 hours. ;)

Thank you for the pointer on data loss, that would have caught me out.
I would prefer not to rely on a battery. Therefore I wish to use
"
PermanentMemory--Non-volatile memory used to store the program block, datablock, system block, forced values ,M memory configured to be saved on loss of power, and
selected values written under user program control
"

Above is mentioned VW memory but reading the book IMHO I feel M memory better?
So...After reading further into the manual the Data word format for the D-A Card 6ES7 232-0HB22 is -32000 to +32000 this is a 16 bits signed integer (INT). The Memory type to use will be M type, configured to be Retentive by using View/Component/System /Block/Retentaive Ranges, but....
Im not sure how to set up 'Data Area' 'Offset' and ' Number of Elements' fields?

Does this make sense??
Cheers

mg
 
You cannot upload or download M memory. You can make it retentive, but you can't save it to your laptop for download to another CPU. Therefore I never use M memory for anything other than generic bits like CPU power on, ALW_OFF, etc. Never for program control.
 
You cannot upload or download M memory. You can make it retentive, but you can't save it to your laptop for download to another CPU. Therefore I never use M memory for anything other than generic bits like CPU power on, ALW_OFF, etc. Never for program control.

Hence the recommendation for VM memory?
 
Here is an example of code to write to EEPROM upon data value change.

My Data Value is not going to change!

I explain better...
I write the program with 24 Integer values, which I wish to select one of (depending on logical switched inputs). The selected Integer is then converted to Analogue voltage.
But I dont want to loose these when power lost (dont wish to use battery therefore i wish to save these in EPROM?

mg
 
Oh, then instead of using VW memory to store the values you want to move, just use constants. Item #1 on my list of how to handle it.

For example:
Move value 1234 to AQxxx
Move value 4567 to AQxxx

Instead of move VW100 to AQxxx...
 
Oh, then instead of using VW memory to store the values you want to move, just use constants. Item #1 on my list of how to handle it.

For example:
Move value 1234 to AQxxx
Move value 4567 to AQxxx

Instead of move VW100 to AQxxx...

Great, thank you

MG
 
Or, which is I think where you started, put values in the Data Block. The advantage of the Data Block is that all values are in one place, and so, easy to find. From the main screen click on Data Block or View/Component/Data Block, define a value such as:

VW100 320
// Integer - Information to remind you what VW100 does
VD102 400.567
// Float/Real - Information to remind you what VD102 does. Float values must have a decimal point, even if it is followed by 0.

You might be able to put the comment on the same line as the variable but I can't remember. Text after the // is treated as comment. If the supercapacitor is exhausted then the PLC will load the values from the Data Block. If you need to modify values you can make the changes then just download the Data Block. The disadvantage is that you will intialise all other variables to zero.

Bryan
 

Similar Topics

I'm a new user for micro win and I uploaded a program to micro win smart v2.3 but all symbol data and comments appears with unknown language so I...
Replies
1
Views
1,965
hello friends and experts, I am here along with question I hope someone help me. I have cpu224 s7 200 PLC which I use in my new project . I have...
Replies
11
Views
12,906
I have an opportunity to quote an HMI project for one of my customers. It's a small project, and the customer is not the type with deep pockets...
Replies
3
Views
24,829
Someone gave me an S7-200 this morning. Don't know what I'm going to do with it - maybe learn a little bit to broaden my horizons... maybe sell...
Replies
3
Views
2,746
I’m struggling to read the individual bits of a word with a Siemens S7-200 PLC. With other PLC types this wouldn’t be an issue but I don’t have...
Replies
9
Views
5,197
Back
Top Bottom