Nirtec Studio Forum

General Category => Machines Simulator => Topic started by: nato76 on March 29, 2024, 10:15:55 AM

Title: UDC Rotary model3D in script code
Post by: nato76 on March 29, 2024, 10:15:55 AM
Hello friends!

I made UDC with rotate model3D in Graph Code.
But I don't now how make it in Script Code.
Can anyone help?
I am attaching the udc file and picture with Graph Code.


Thank you for your help. :)
Title: Re: UDC Rotary model3D in script code
Post by: EasyPLC_Master on March 30, 2024, 09:27:22 AM
Hi Nato!

This is the code:

public void Main()
{

if(UC.GetOutput("On"))
{
float speed = UC.GetAOutput("Velocity");
Motor2.AnimationRotations(new Vector3(0, speed, 0));
if(speed > 0)
UC.SetInput("FbOn", true);
else
UC.SetInput("FbOn", false);
}
else
UC.SetInput("FbOn", false);


}
public void Physics()
{

}

public void Finish()
{
 
}
Title: Re: UDC Rotary model3D in script code
Post by: nato76 on March 30, 2024, 01:45:41 PM
Hi EasyPLC_Master!

Thank you very much :)

Regards.