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 January 9th, 2012, 03:57 PM   #1
joigunni
Supporting Member
Iceland

joigunni is offline
 
Join Date: Jan 2011
Location: Iceland
Posts: 52
Citect/cicode

Hi
I have a Local Variables in Citect set with “zero scale=0” and “full scale =12” now I want to change the full scale at Runtime, can I do that in Cicode?
  Reply With Quote
Old January 10th, 2012, 03:44 PM   #2
jimtech67
Member
United States

jimtech67 is offline
 
jimtech67's Avatar
 
Join Date: Jun 2002
Location: New Jersey
Posts: 247
This is a bump

I would love to know if this is possible.
  Reply With Quote
Old January 10th, 2012, 08:03 PM   #3
PeterW
Member
Canada

PeterW is offline
 
Join Date: Jun 2006
Location: Edmonton
Posts: 2,486
Are these tags in the tag base? real IO or memory.

CICODE cannot access tags but you can pass and return parameters.

eg

CICODE


INT
FUNCTION
TEST(INT A)

INT X = A;

RETURN X
END

from the graphic page have an instruction, inside a button perahps


FullScale = TEST(NewValue)





Is this what you mean?



edit. Not sure I've answered right, thinking now you may have a string tag with the contents "Full Scale =12", if so then the above maybe still valid as a pointer, instead of INT at the beginning use STRING and the entry argument could be changed to STRING etc.

Last edited by PeterW; January 10th, 2012 at 08:09 PM.
  Reply With Quote
Old January 10th, 2012, 08:24 PM   #4
Dua Anjing
Member
Australia

Dua Anjing is offline
 
Dua Anjing's Avatar
 
Join Date: Feb 2008
Location: under the desk looking for a donut...
Posts: 435
In earlier versions it was actually possible (but not simple,easy or recommended). There were a set of undocumented functions relating to RDB's. RDB's are (or were) the runtime data base files that Citect used when you compiled youre project. One problem with doing them would be that next time you compile dyou would overwrite the RDB with data from the off-line file (variable.dbf) But that wa sin earlier versions (V3 & V4) I havn't used any of these in later version sand don't even know if they still exist.
__________________
Now that food has replaced s*x in my life I can't even get into my own pants
  Reply With Quote
Old January 11th, 2012, 03:28 PM   #5
joigunni
Supporting Member
Iceland

joigunni is offline
 
Join Date: Jan 2011
Location: Iceland
Posts: 52
ok, but thanks for your help, have to find some other way.
  Reply With Quote
Old January 26th, 2012, 07:40 AM   #6
tragically1969
Member
United Kingdom

tragically1969 is offline
 
Join Date: Jun 2007
Location: uk
Posts: 635
Quote:
Originally Posted by joigunni View Post
ok, but thanks for your help, have to find some other way.
As people took the time to answer you and give advice it would be considered courteous to share how you did it if you did find a solution.......
  Reply With Quote
Old January 29th, 2012, 02:48 AM   #7
joigunni
Supporting Member
Iceland

joigunni is offline
 
Join Date: Jan 2011
Location: Iceland
Posts: 52
I did not find a actual solution. In my program I have a weight scale mad by rectangle that will fill up by red color when it sense some weight. The scale is from 0 to 500 kg. In some case I want to be able to change to higher scale, like from 0 to 2000 kg. At first I put the scale setting in the “Variables Tags” to “Eng Zero Scale = 0” and “Eng Full Scale=500” but as you know there is no way to change those scale in run-time so I cleared those settings and instead made small mat-formula.

Calculated_weight= ((input_weight*3)*2000)/scale_value

// Analog input from PLC give me scale that is 0-10500,
//variable-tag scale is 0-32000
//Max weight is 2000kg
//on Max weight 2000kg I will get 10500 from PLC analog-input

if I put the scale_value to 500kg, the math will look like this:
Calculated_weight= ((10500*3)*2000)/500
Calculated_weight=126000

And if I got 500kg on PLC input, PLC will give me 2625, and the math will look like this:
Calculated_weight= ((2625*3)*2000)/500
Calculated_weight=31500
And the rectangle will be filed

If I still have 500kg on PLC input, and put the scale_valu to 1000kg, the math will look like this:
Calculated_weight= ((2625*3)*2000)/1000
Calculated_weight=15750
And the rectangle will be half filed
  Reply With Quote
Old January 29th, 2012, 02:32 PM   #8
PeterW
Member
Canada

PeterW is offline
 
Join Date: Jun 2006
Location: Edmonton
Posts: 2,486
Quote:
Originally Posted by joigunni View Post
but as you know there is no way to change those scale in run-time
I don't know, I'm currently passing data between citect tags, variable tags and IO tags with citect, using the method I said above. (It appears my reply was ignored though)

Maybe its an 'English not first language' problem. But I still don't know the format of the tags you were trying to change, the way you put the lot in a string made it look like the tags were string tags, but your talking about numbers which means integer.

Confusing.
  Reply With Quote
Old January 29th, 2012, 06:08 PM   #9
joigunni
Supporting Member
Iceland

joigunni is offline
 
Join Date: Jan 2011
Location: Iceland
Posts: 52
You are probable right, ‘English not first language’ problem. I’m using integer Tags.
See this picture, I’m trying to change this parameters “zero scale=0” and “full scale =100”, I mean I want to change this parameters in Runtime.

Attached Images
File Type: png Citect2.PNG (150.8 KB, 44 views)
  Reply With Quote
Old January 29th, 2012, 06:28 PM   #10
jimtech67
Member
United States

jimtech67 is offline
 
jimtech67's Avatar
 
Join Date: Jun 2002
Location: New Jersey
Posts: 247
I got his from Citect Support when I inquired.

Hello Jim,

It is not possible to change the scaling when the application is running and get the changed scale to be implemented online. There is no cicode function or mechanism to achieve the requirement in v6.10. It is because potentially it could cause an mismatch of historical trend data and thus, hindering the system to run (if you are trending the variable tag).

In v7.xx onwards, you can do online changes by restarting the necessary processes after you made the changes (running multi-process). Other than that, there is no mechanism to change the scale of the tag on-the-fly.

Please advise me if you have further inquiry.

Best Regards,
Dennis
  Reply With Quote
Old January 30th, 2012, 03:41 PM   #11
chelton
Member
Australia

chelton is offline
 
Join Date: Jan 2012
Location: melbourne
Posts: 58
Quote:
Originally Posted by joigunni View Post
You are probable right, ‘English not first language’ problem. I’m using integer Tags.
See this picture, I’m trying to change this parameters “zero scale=0” and “full scale =100”, I mean I want to change this parameters in Runtime.

Why not create a "scale" tag that can be changed at runtime, then from your rectangle "fill properties" call a cicode function to create the scale you want.
Attached Images
File Type: jpg tags.jpg (33.0 KB, 18 views)
File Type: jpg graphics.jpg (32.6 KB, 16 views)
File Type: png code.PNG (5.9 KB, 18 views)
  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


All times are GMT -5. The time now is 02:57 AM.


.