Welcome, Guest. Please login or register.
Did you miss your activation email?
May 22, 2012, 06:03:39 AM
Home Help Login Register
News: Any Problems or Experience with Industrial Robots ?
Register and place your Question / Answer to worldwide Robotexperts right here !

+  Robotforum | Support for Robotprogrammer and Users
|-+  Industrial Robot Help and Discussion Center
| |-+  Comau Robots (Moderators: Werner Hampel, Jim Tyrer, Martin H, Fabian Munoz)
| | |-+  has anyone worked well with GLOBAL variable?
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: has anyone worked well with GLOBAL variable?  (Read 660 times)
zhaohqing
Guest
« on: June 30, 2011, 05:05:30 PM »

hallo, all,

i'm using C4G.. have to write 2 programes use the same varialbe which assigned by one of them, does here anyone have done this thing before?
I have wroten exactly what the Manual told, but, its never worked...

Thanks...

Hongqing
Logged
jorger
Newbie
*
Offline Offline

Posts: 5


« Reply #1 on: June 30, 2011, 06:23:21 PM »

Hello,

For example using two programs (one main.cod and one def_cod.cod) i use the folwing definition and i can use the variable Vi_Programa in any of them.

main.cod
VAR
    Vi_Programa : INTEGER EXPORTED FROM def_cod

-----------------------------------------------------------------------------
def_cod.cod
VAR
    Vi_Programa : INTEGER EXPORTED FROM def_cod


I use like this and works all time
Logged
zhaohqing
Guest
« Reply #2 on: July 01, 2011, 09:12:16 AM »

 thanks jorger,

i have already tried your mentioned methode, and it works well. thanks very much..

but it is also incovienient, while the GLOBAL doesnt work, because i have 50 Rountine in main.cod to share, use your methode i have to add 50 rows in any other programmes.

I'm wanderring, why the GLOBAL does not work... hnnnn

hongqing
Logged
bidzej
Newbie
*
Offline Offline

Gender: Male
Posts: 43


« Reply #3 on: March 07, 2012, 06:16:49 PM »

Hi,

I have a very similar problem working with C5G. There is a main program that includes some counters and one of them needs to be shared with a sub-program. No idea how to define a GLOBAL variable with TP - manuals say that the definition should be var_name GLOBAL, but that doesn't work (incorrect variable name). I have also tried editing the sub-program and selecting Program -> Variables -> Import -> then choosing the main program and the variable I need - but then an error occurs, saying that the variable doesn't exist ( kopfkratz). What can I do to make it work? The only programming device I can use at the moment is the TP. Is there any other way of editing program code than using IDE?
Logged
Pages: [1] Print 
« previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!