Time Scheduling in Enterprise dynamics

All topics specific to modeling questions in Enterprise Dynamics
Post Reply
panda_mic2000
Posts: 10
Joined: Thursday 29 February, 2024 - 16:26

Time Scheduling in Enterprise dynamics

Post by panda_mic2000 »

Hello Everyone,
I'm making a bottling line for my thesis. I want to run a time schedule of the production on only 1 machine in enterprise dynamics. Essentially, the conveyor has to send a product to either one of the 3 following machines depending on the time(photo attached)
ED Sims photo.png
ED Sims photo.png (94.02 KiB) Viewed 7219 times
. The schedule is written into excel, and I use Excel_activeX to read the time, but I'm facing a problem of having to continuously run the condition and check for each possible time whether it has passed a certain number of hours. I've tried using loops, but I'm not able to figure out how to write this condition down. I have currently used a case statement to read through only the first 3 time conditions in the excel (photo given), but if I am to run it for over 50 times, how do I create a loop to do so?
ED excel photo.png
ED excel photo.png (5.35 KiB) Viewed 7219 times
ED case statement.png
ED case statement.png (100.86 KiB) Viewed 7219 times
User avatar
Gabe-Hein Dijkstra
Posts: 22
Joined: Friday 13 May, 2022 - 10:16

Re: Time Scheduling in Enterprise dynamics

Post by Gabe-Hein Dijkstra »

Hi panda_mic2000,

Thanks for the further explanation. I was just commenting on your other post. As also stating there, maybe the "User Events" atom could prove useful. I will be happy to help you further if you run into any problems.

Kind regards,
Gabe-Hein
panda_mic2000
Posts: 10
Joined: Thursday 29 February, 2024 - 16:26

Re: Time Scheduling in Enterprise dynamics

Post by panda_mic2000 »

Hey Gabe-Hein,

Thanks for the super quick reply. Is there any way to directly connect excel to the user events function? More importantly, in user events, how do I reference the Send To variable of the conveyor? I don't find any command to directly reference that, would I have to create a label, assign a value everytime, or can I directly use a command to reference the send to value?

Thanks
User avatar
Gabe-Hein Dijkstra
Posts: 22
Joined: Friday 13 May, 2022 - 10:16

Re: Time Scheduling in Enterprise dynamics

Post by Gabe-Hein Dijkstra »

Hi panda_mic2000,

There unfortunately is not an option to link Excel directly to the User Events atom. I think it is best to read in the Excel table into ED on reset and store it in a table. These settings can be found on the tab "Tables" of the ExcelActiveX atom. The function "Cell()" can then be used to refer to the values in the table.

Updating and referencing the "Send To"-statement using code requires some more advanced techniques. The "Send To"-statement of an atom (in this case conveyor) is stored in an attribute. To retrieve the the current value of the "Send To"-attribute of the atom with reference refConveyor you can use

Code: Select all

TextAtt([SendTo], refConveyor)
Note: using Att([SendTo]) will trigger the "Send To"-statement to be executed and will return the outcome of the code in the "Send To" instead of the code itself.

You can overwrite the "Send To"-statement by using

Code: Select all

SetExprAtt([SendTo], [NewCode], refConveyor 
Kind regards,
Gabe-Hein
panda_mic2000
Posts: 10
Joined: Thursday 29 February, 2024 - 16:26

Re: Time Scheduling in Enterprise dynamics

Post by panda_mic2000 »

Hey Gabe,

Thanks for this. It did work, but was a little complex, so I found a simple loop to read directly from the excel, and it works very well. Putting this up for anyone else who wants to use this for time scheduling-
Attachments
ED excel statement.png
ED excel statement.png (44.88 KiB) Viewed 7195 times
Post Reply