Read data and import in Maschine

Hay,

I am new to Visual Components. In our school we have a hydraulic press and we can measure its path. I also made 3D model and import it into visual components. But now I want to read data from excel, but I stuck in the process. Can somebody help me out? First, I want to make that 3D model moves like the data in excel second If that would be successful that 3D model moves like a real one.

For any help I would be very happy
David

Hy,

you get data in an Excel-File. -> Save it as csv because it’s easier to read in… :wink:

  • find out the time difference between the measured data. (t=0;v=x1 | t=0.02;v=x2 | …) -> timeSteps=0.02

  • code a import-method for your data

  • create boolean-signals for control when to drive your hydraulic press

  • Take the example script and make your version out of it… :slight_smile:

    def OnRun():
      while True:
      triggerCondition(lambda: getTrigger() == DriveMachine)
      if DriveMachine.Value:
        #Import waypoints here with your csv-import-method!!!!!!
        for v in wayPointList:
      	  valueZylinderpaar = float(v.replace(",", "."))
      	  ServoController.moveImmediate(v)
          delay(0.02) #Here is the timeStep!!!
    

Regards
Feature