Cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

CSE X-axis move with variable value.

Experimenter
Experimenter

2019-08-14_07-41-50.jpg2019-08-14_07-41-40.jpg

Hi

I have a X-axis move that do not work.

 

G01 X=((_VAC_KOMP[200]*2)-0.5) F500

 

The variable _VAC_KOMP is an array and the value for _VAC_KOMP[200] is 100. 

And I got these errors.

 

Any ideas anuone?

 

Best Regards

Christer

 

5 REPLIES 5

Re: CSE X-axis move with variable value.

Siemens Phenom Siemens Phenom
Siemens Phenom

Hi Christer,

 

how does the variable declaration for _VAC_KOMP look like

I checked the following nc code and it works properly

def nck real _VAC_KOMP[200]
_VAC_KOMP[199]=100
X=((_VAC_KOMP[199]*2)-0.5)

Keep in mind that the field size definition is zero based. So accessing _VAC_KOMP on field [200] will not work. Therefore the highest possible value is 199 when its defined with a field size 200.

 

Thomas


					
				
			
			
				
			
			
				
			
			
			
			
			
			
		

Re: CSE X-axis move with variable value.

Experimenter
Experimenter

Hi

It worked.

 

I did tried to define the variable in Machine Configurator as a global variable.

Now I put in the definition in the ini-file.

 

Thanks for a quick answer.

 

Christer

Re: CSE X-axis move with variable value.

Siemens Phenom Siemens Phenom
Siemens Phenom

Hi Christer,

 

it´s not a  problem if its defined in the Machine Configurator and if its global or not. It´s a question of the size definition of this array. It doesn´t matter if its defined in MC or in the ini file. Both places are valid and work similar.

 

Thomas

Re: CSE X-axis move with variable value.

Experimenter
Experimenter

Ok

 

Another thing.

Do I need to rewrite "X" in the metacode due to "X="?

I got this error now.

 

2019-08-14_10-24-34.jpg

 

 

/Christer

Re: CSE X-axis move with variable value.

Experimenter
Experimenter

Hi

Solved, my bad...

 

/Christer

Learn online





Solution Information