read Excel every second for changes
read Excel every second for changes
Hi all,
I have a question about my project, I want to read my excel file every second or by a push message. But I don't know what I need to enter in the red marked field (see attachment).
What is the 4DS syntax for every second?
Rens
I have a question about my project, I want to read my excel file every second or by a push message. But I don't know what I need to enter in the red marked field (see attachment).
What is the 4DS syntax for every second?
Rens
Re: read Excel every second for changes
Hi Rens,
Could you please explain me a little more about your model / approach. I don't know whether it is a good idea to update your model data every second from excel.
Regards, Nick
Could you please explain me a little more about your model / approach. I don't know whether it is a good idea to update your model data every second from excel.
Regards, Nick
Re: read Excel every second for changes
Hi,
Thanks for your interest and reaction,
I use my ED in combination with Microsoft Visual Studio. Visual Studio is my user interface, so you can change some objects or product flows in the model.
I have a production of goods some buffers and packing machines. My goal is to find out if one big packers is better than more smaller packers. So I can select in Visual Studio which packer I want to use and what his capacity is (products/hour).
I can not set up a direct connection between Visual Studio and ED, therefor I use 'database' in Excel. I put my settings in the database and want to read them in ED. Now I have a connection but ED reads my Excel only on resets, now I want to receive data every second or if there are changes in Excel.
Best Regard,
Rens
Thanks for your interest and reaction,
I use my ED in combination with Microsoft Visual Studio. Visual Studio is my user interface, so you can change some objects or product flows in the model.
I have a production of goods some buffers and packing machines. My goal is to find out if one big packers is better than more smaller packers. So I can select in Visual Studio which packer I want to use and what his capacity is (products/hour).
I can not set up a direct connection between Visual Studio and ED, therefor I use 'database' in Excel. I put my settings in the database and want to read them in ED. Now I have a connection but ED reads my Excel only on resets, now I want to receive data every second or if there are changes in Excel.
Best Regard,
Rens
Re: read Excel every second for changes
Hi Rens,
You can use the User Events atom to create a function (User Event) which executes the function 'ExcelActiveX_Read()' at specified intervals, i.e. every 1 second. Refer to this user event function in the capacity field of the buffer/packer atoms.
Regards, Nick
You can use the User Events atom to create a function (User Event) which executes the function 'ExcelActiveX_Read()' at specified intervals, i.e. every 1 second. Refer to this user event function in the capacity field of the buffer/packer atoms.
Regards, Nick
Re: read Excel every second for changes
Hi Nick,
In the HELP I can not find information over 'ExcelActiveX_Read()'. Do you know where I can find this information over this function. E.g. parameters.
I want to update every second my excel table, with the red marked button in the Annex I reach this. But how can i do this by 4d Script?
Rens
In the HELP I can not find information over 'ExcelActiveX_Read()'. Do you know where I can find this information over this function. E.g. parameters.
I want to update every second my excel table, with the red marked button in the Annex I reach this. But how can i do this by 4d Script?
Rens
- Attachments
-
- Capture2.PNG (39.18 KiB) Viewed 6602 times
Re: read Excel every second for changes
Hi Rens,
Attached the example model (incl. Excel file) for the ExcelActiveX atom with some minor modifications to read the Excel file every x seconds.
I added a User Event atom which defines a function that calls the Excel file every minute (you can change that to 1 second if you want). If you alter a value in the Excel inbetween (for example the Queue dimension) you will see that after the next call, the capacity attribute is changed.
Regards,
Simon
Attached the example model (incl. Excel file) for the ExcelActiveX atom with some minor modifications to read the Excel file every x seconds.
I added a User Event atom which defines a function that calls the Excel file every minute (you can change that to 1 second if you want). If you alter a value in the Excel inbetween (for example the Queue dimension) you will see that after the next call, the capacity attribute is changed.
Regards,
Simon
- Attachments
-
- ExcelActiveX.xls
- the input file
- (17 KiB) Downloaded 286 times
-
- ExcelActiveX_Topic.mod
- The model
- (21.05 KiB) Downloaded 289 times