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

When the model read in the data from an Excel file, only half of the machines in the sub-frame got the data.

Creator
Creator

In the attached model I linked an Excel file for the input data. I put the code in Init file. But I noticed that only half of the machines in the Sub-frame got the input data. The other half of the machines never have. It skipped the 1st machine, then the 2nd machine was OK, then skipped the 3rd one, then the 4th works Ok, and so on. I don't know why. 

 

When I have a few Sub-frames in the model, is this the best way to input data from Excel? 

 

All the machines in the main frame works OK. 

 

Please help. 

Thanks

4 REPLIES 4

Re: When the model read in the data from an Excel file, only half of the machines in the sub-frame got the data.

Phenom
Phenom

could it be , that you are twice incrementing 

 

the loop  index "i" ?

 

Unbenannt.PNG

 

 

 

Re: When the model read in the data from an Excel file, only half of the machines in the sub-frame got the data.

Creator
Creator

The Loop is for all the machines. And I have been using this method to input data from long time. It works OK for all the main frame machines. I never have any problems. But it skipped all the Odd numer machines in Sub Frame. I don't know why. 

Re: When the model read in the data from an Excel file, only half of the machines in the sub-frame got the data.

Phenom
Phenom

This is the output from the 

 

the double incremented loop index.

 

Is that what you want ?

 

If not, delete the i:=i+1 statement in the loop.

 

 

Unbenannt.PNG

Re: When the model read in the data from an Excel file, only half of the machines in the sub-frame got the data.

Creator
Creator
It works after I deleted i=i+1. Thank you.