You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old February 22nd, 2006, 12:18 PM   #1
Pandiani
Member
Bosnia

Pandiani is offline
 
Pandiani's Avatar
 
Join Date: Apr 2005
Location: Tz
Posts: 649
representing analog data in STEP 7

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!
  Reply With Quote
Old February 22nd, 2006, 12:23 PM   #2
PLucas
Member
England

PLucas is offline
 
PLucas's Avatar
 
Join Date: Apr 2002
Location: Gillingham Kent
Posts: 1,743
Pandiani

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

Paul
__________________
There are 10 types of people in this world..
Those who understand binary and those who don't!
  Reply With Quote
Old February 23rd, 2006, 02:41 AM   #3
Ken M
Member
Scotland

Ken M is offline
 
Join Date: Mar 2004
Location: .
Posts: 1,137
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
  Reply With Quote
Old February 23rd, 2006, 04:27 AM   #4
PLucas
Member
England

PLucas is offline
 
PLucas's Avatar
 
Join Date: Apr 2002
Location: Gillingham Kent
Posts: 1,743
Quote:
Originally Posted by Ken M
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.

Paul
__________________
There are 10 types of people in this world..
Those who understand binary and those who don't!
  Reply With Quote
Old February 23rd, 2006, 05:45 AM   #5
SimonGoldsworthy
Member
United Kingdom

SimonGoldsworthy is offline
 
SimonGoldsworthy's Avatar
 
Join Date: Mar 2005
Location: England
Posts: 1,079
Maybe he had entered it in the symbol table but had not saved it ?
  Reply With Quote
Old February 23rd, 2006, 10:20 AM   #6
Pandiani
Member
Bosnia

Pandiani is offline
 
Pandiani's Avatar
 
Join Date: Apr 2005
Location: Tz
Posts: 649
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.
Attached Files
File Type: zip Pictures.zip (76.0 KB, 45 views)
  Reply With Quote
Old February 23rd, 2006, 10:48 AM   #7
SimonGoldsworthy
Member
United Kingdom

SimonGoldsworthy is offline
 
SimonGoldsworthy's Avatar
 
Join Date: Mar 2005
Location: England
Posts: 1,079
Quote:
Originally Posted by PLucas
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.
  Reply With Quote
Old February 23rd, 2006, 10:51 AM   #8
RMA
Member
Scotland

RMA is offline
 
RMA's Avatar
 
Join Date: Sep 2004
Location: North of Hamburg, Germany
Posts: 2,044
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 by RMA; February 23rd, 2006 at 10:55 AM.
  Reply With Quote
Old February 23rd, 2006, 01:27 PM   #9
Pandiani
Member
Bosnia

Pandiani is offline
 
Pandiani's Avatar
 
Join Date: Apr 2005
Location: Tz
Posts: 649
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?
  Reply With Quote
Old February 23rd, 2006, 01:57 PM   #10
PLucas
Member
England

PLucas is offline
 
PLucas's Avatar
 
Join Date: Apr 2002
Location: Gillingham Kent
Posts: 1,743
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

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
__________________
There are 10 types of people in this world..
Those who understand binary and those who don't!
  Reply With Quote
Old February 23rd, 2006, 03:03 PM   #11
Pandiani
Member
Bosnia

Pandiani is offline
 
Pandiani's Avatar
 
Join Date: Apr 2005
Location: Tz
Posts: 649
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!
  Reply With Quote
Old February 24th, 2006, 12:43 AM   #12
SimonGoldsworthy
Member
United Kingdom

SimonGoldsworthy is offline
 
SimonGoldsworthy's Avatar
 
Join Date: Mar 2005
Location: England
Posts: 1,079
Quote:
Originally Posted by Pandiani
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.
  Reply With Quote
Old February 24th, 2006, 02:00 AM   #13
PLucas
Member
England

PLucas is offline
 
PLucas's Avatar
 
Join Date: Apr 2002
Location: Gillingham Kent
Posts: 1,743
Quote:
Originally Posted by SimonGoldsworthy
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...

Quote:
Originally Posted by PLucas
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.....

Quote:
Originally Posted by PLucas
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...

Quote:
Originally Posted by PLucas
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
__________________
There are 10 types of people in this world..
Those who understand binary and those who don't!
  Reply With Quote
Old February 25th, 2006, 02:30 AM   #14
Pandiani
Member
Bosnia

Pandiani is offline
 
Pandiani's Avatar
 
Join Date: Apr 2005
Location: Tz
Posts: 649
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?
  Reply With Quote
Old February 25th, 2006, 02:49 AM   #15
Ken M
Member
Scotland

Ken M is offline
 
Join Date: Mar 2004
Location: .
Posts: 1,137
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
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
Devicenet Error Code 77 ganutenator LIVE PLC Questions And Answers 22 January 9th, 2014 08:43 AM
MPI comunication Manuel Raposo LIVE PLC Questions And Answers 22 July 16th, 2007 06:24 AM
simulate analog values in STEP 7 Pandiani LIVE PLC Questions And Answers 4 September 20th, 2005 02:16 AM
PLC control of stage lights Thesis LIVE PLC Questions And Answers 3 June 21st, 2004 09:44 PM
Creating a register array to sequence rsdoran LIVE PLC Questions And Answers 15 October 17th, 2003 11:22 PM


All times are GMT -5. The time now is 03:37 AM.


.