representing analog data in STEP 7

Pandiani

Lifetime Supporting Member
Join Date
Apr 2005
Location
Tz
Posts
718
Hello guys, I have one little problem at work. I'm writting a ladder diagram program that will manipulate with analog values. Since analog values are interpreted as INT numbers 0-27648, I can access analog input channel as PIW 288 (for example), and if I use instruction Move for example as IN (input) I put PIW288 and it works. Now when I give simbolic name to PIW288 in Symbol table (example Analog_input) and write "Analog_input" to IN (Move) programs refuse to accept this. It seems that program can accept directly PIW288, but not it's symbolic name.
Does anyone have similar experience?
Thanks!
 
Pandiani

Although you're asking here about moving a value, I'm going to predict the future. Usually the only reason people move things is to do something with them. Nobody just moves a value and abandons it there. So, I predict you probably want to scale the value, yes? And that's going to be the next question?
There's a function for this in the STEP7 Library in the folder Converting TI - S7. It's FC105 and it's named SCALE. The Help file should provide adequate information about what the parameters are.

Paul,

I can't check just now, but doesn't a MOVE instruction accept just about any datatype up to double-word length? It shouldn't refuse a WORD or an INT as far as I know.

Regards

Ken
 
Ken M said:
Paul,

I can't check just now, but doesn't a MOVE instruction accept just about any datatype up to double-word length? It shouldn't refuse a WORD or an INT as far as I know.

Regards

Ken

Ken, you are quite correct, that is why I couldn't understand why Pandiani had a problem. But I offered what I said just in case this is one of those little nuances (is that spelt right?)that you get with step7 from time to time. :confused:

Paul
 
Ok, thanks for that prediction, that would be my next question, but that is not really
a problems because of which I started this thread. I've noticed one thing that I couldn't
explain and that is rejecting symbolic names by some blocks. I said Move instruction, but
I was wrong, I'm sorry, I assumed that is the case for Move instr. too, but it's not.
So, what exactly is a problem?
Let's take FC 105 (Scale) for example.
1. I've created new project and create entry in Symbol tabel just like on picture Case_1_sybmol_table
and I give name "Analog_input" for PIW288
2. In OB1 I place FC105 on rung and when I enter input and output data, FC105 reject to accept PIW288
(picture Case1_ob1.jpg), then I tried to enter sym. name "Analog_input" in field IN but result is same
just like on picture Case1_symbolic.jpg
3. To solve this problem, I've deleted name "Analog_input" from symbol table and now I have table just like
on picture Case2_symolic_table
4. Then on input IN on FC I enter PIW 288, and FC accept it, just like on picture Case2_OB1.

After every change in symbolic table I saved it so that's not causing this problem.

In short problem is that FC is not accepting PIW 288 nor it's symbolic name, but when symbolic name
is deleted FC accept this address PIW 288

Can you check this to make sure is this the case with your software?
If you're willing I could send this Test project to check it yourself.
 
PLucas said:
Pandiani

Have you got the data type for PIW128 set as WORD in the symbol table rather than INT?

Paul

I think you will find this is your problem. The symbol table you have posted has the type as word, it should be INT.
 
Are you sure that PIW288 is a valid input? You can check it in Hardware Config.

Oops, too late and I see I didn't read the last post carefully enough since it did work when the Symbol name was deleted. Unfornately, on this (customer) PC I haven't the possibiility to unzip the picture.

The Symbol does need to be defined as an INT.
 
Last edited:
Well, in symbol table when I type PIW288, Step 7 automatically give WORD for type. So should I change it to INT no matter that default is WORD. I expect PIW to be WORD because I think the meaninig is Peripheral Inuput Word.
What should I do?
 
This is getting curious.

I have just had a little edit of a project that I have on my laptop, it has some analogue inputs in it, already declared as WORD in the symbol table.

I added a network and dropped FC105 on it, on the IN pin I tried to insert the symbol name of the PIW (in my case PIW368), Step 7 didn't like it, I then tried to insert the address (PIW368) again Step 7 didn't like it. I changed the declaration in the symbol table from WORD to INT, and tried again, Step 7 didn't like the symbolic name or the address. Next, I entered PIW288 (not declared anywhere in the project), Step 7 was quite happy with that. I then added PIW288 to the symbol table declared as a WORD, again step 7 was happy with this.

I can't explain why that would be, unless it is due to the fact that Step 7 knows I am reading PIW368 in another FC and it will only let you read an analogue Input once per scan :confused:

To add to the curiosity, I then added the symbol name "test", address PIW376 (next in line) to the symbol table declared as a WORD, I tried to put this onto the IN pin and Step 7 didn't like it, when I changed the declaration in the symbol table to INT, step 7 was happy with both the symbolic name and the address.

Paul
 
Paul, that is exactly what is interesting me. In my project I'm using PIW288 directly in program without simbolic names . I didn't change data type declarations which STEP 7 suggested, and using PIW XXX works, but whay is that, it's big mistery for me.
When I enter for example PIW 288 which is not entered elswhere in program Step7 is happy with it, but when I added PIW 288 in symbolic table (while PIW is still used in FC105), Step7 replace PIW with its symbolic name but it becomes red. I'm really curious about this.
Thanks very much for help!
 
Pandiani said:
Well, in symbol table when I type PIW288, Step 7 automatically give WORD for type. So should I change it to INT no matter that default is WORD. I expect PIW to be WORD because I think the meaninig is Peripheral Inuput Word.
What should I do?

CHANGE THE SYMBOL TABLE ENTRY TO INT ! FC105 must be supplied with an integer variable. If you hover the mouse over the PIWxxx that is in red, the hint text tells you what is wrong.
 
SimonGoldsworthy said:
CHANGE THE SYMBOL TABLE ENTRY TO INT ! FC105 must be supplied with an integer variable.

That is quite correct Simon, I certainly agree with you but...

PLucas said:
I changed the declaration in the symbol table from WORD to INT, and tried again, Step 7 didn't like the symbolic name or the address.

That was using a PIW already called in the program, but after that I tried this.....

PLucas said:
I then added the symbol name "test", address PIW376 (next in line) to the symbol table declared as a WORD, I tried to put this onto the IN pin and Step 7 didn't like it, when I changed the declaration in the symbol table to INT, step 7 was happy with both the symbolic name and the address.

The statement above verifies what we thought in the first place, Step 7 does take notice of the declared data type.

Here's another part that I failed to understand, taking into account the two statements above...

PLucas said:
I entered PIW288 (not declared anywhere in the project), Step 7 was quite happy with that. I then added PIW288 to the symbol table declared as a WORD, again step 7 was happy with this.

That seems to say that Step 7 will accept 'anything' on the IN pin, providing the data type hasn't been declared, then even after it has been added to the symbol table and declared as the wrong data type, it is still quite happy with the address, even after a save.

Paul
 
In my other program I used (example) PIW 288 directly in program without adding any names to symbol table and it was working OK. Is that wrong or? Should I put symbolic name for PIW288 and declare it as type INT? Is there going to be any problems when using PIW directly as I'm using it right now. Should I chaneg it or not?
 
I'm not at a PC with STEP7 just now so I can't check for myself. Can someone test the effect of using IW288 rather than PIW288?

Pandiani,
Is your process so time-dependent that you need to read PIW288 rather than IW288 for this input?

Regards

Ken
 

Similar Topics

We have a new installation with a brand new PowerFlex 755 (20hp). Motor nameplate is 1175 RPM, yet I was told it was running a little over...
Replies
11
Views
2,795
Hi, I can figured out how to make two picture blinking alternating. I have two pictures one is colored in yellow and the other is colored in red...
Replies
18
Views
5,365
Hi We're having issues with an FX1N-1DA-BD Analog output module. We're using an metallic contamination sensor MCS 1000 to detect particles. This...
Replies
1
Views
60
I am converting a SLC 500 to a Compact Logix. I plan on using a Compact Logix 5380 with conversion Kit. The problem is that the analog input cards...
Replies
1
Views
114
Hi there, I'm doing some extensive testing and commissioning with a slew of new Emerson PACSystems RX3i PLCs. It would be convenient to...
Replies
5
Views
80
Back
Top Bottom