Any way to make objects move that aren't animation objectshttps://forum.weintekusa.com/uploads/db0776/original/2X/7/7d91892c55221321209bec532e8a096da82e269e.png
Hey there, I have been poking around the manuals and tutorials and haven’t seen anything that could be helpful.
Basically I would like to be able to move some labels, shapes, toggle switches, etc around and axis in the center of a graphic that represents a rotary table. this would read the table position to determine the position of the graphic
Is there any way to actually do this? it seems to me that the only objects that can be animated are those that are created with an animation object, so I would only be able to animate bit lamps. Additionally, these positions would have to be hand placed in a circle which is less than ideal.
I think you can attempt to use Direct Window objects with the “Dynamic position” option checked. This way the Direct Window will display a popup window that accommodates your labels, shapes, Toggle object, etc, when the popup moves to the position you want by sending X,Y position values to the specified two registers.
The X, Y values for positioning can be found on the bottom of the EBpro IDE when you move your mouse cursor on the editor.
There have been a couple issues that I have encountered. The first is that is the words for window placement need to be integers and the calculated locations are rarely nice round integers. I haven’t thought of a solution for this yet.
The next issue that I am having is that the macro that I wrote to do this math seems to be outputting bad data. like COS(180) is coming out as 2.590… when its supposed to be -1. Similar issue with SIN(180).
Here is the macro that I am using to calculate the position.
macro_command main()
float angle = 0.00
//radius of the circle
float r = 290.00
float ux, uy
float x, y
GetData(angle, "Local HMI", LW, 15, 1)
//calc the position using COS and SIN
COS(angle, ux)
SIN(angle, uy)
//print the results of the calculation
SetData(ux, "Local HMI", LW, 18, 1)
SetData(uy, "Local HMI", LW, 19, 1)
//caluculate exact coordinates using the radius of the circle and the offset
x = r * ux + 960.00
y = r * uy + 540.00
//send the data to the HMI
SetData(x, "Local HMI", LW, 20, 1)
SetData(y, "Local HMI", LW, 21, 1)
end macro_command
Any insight you can provide on the bad Trigonometry outputs and the best way to get these values as integers for the window coordinate would be great.
Moments after posting this, it occurred to me that the floats take up two words. offsetting the words has fixed the bad data issue,
I have looked at datatype conversion and the macros don’t seem to have a robust solution for converting from a float to an INT. Made even more difficult by the fact that the indirect window wants to use a single 16bit word vs the 32bit float. Any ideas on how to make this work is appreciated.
Along that same line, I have a fan image object that I would like to rotate (spin) in place when I “start” my process for a visual that our equipment is running. I have tried everything I can find, but can’t seem to figure it out. Thoughts? Recommendations?
Thanks for reaching out! You can achieve this a couple different ways. My recommendation would be to use a a 2 state picture, one being a still of the fan and second being a .gif of the fan spinning. You can control this by tying it to some bit that triggers when your machine is online. I went ahead and attached the .gif that I used in testing if you would like to give it a try.
Thank you so much! I’ve been literally searching for weeks.
That is the movement I am looking for, however our image is a .jpg, not a .gif. Any recommendations for using a multi-state object? Or what software to create a .gif?
There’s a handful of software that can help! In this instance I took the still image, uploaded it into Kling AI to convert that to a animated mp4, then took that mp4 and created an infinite .gif using the link below! If you have any questions don’t hesitate to ask.
You have been SO helpful! I was able to find software and convert our image to a .gif and rotate it on a loop.
My next step is to set it up to be stationary when our equipment is idle and spin when our equipment is running. I am able to insert the .gif as a picture that rotates, but that won’t accept any instruction tags. I’m extremely green here, so please bear with me. I’m going to try setting it up as a Bit Lamp, unless you have another suggestion.
Wish I had found this forum a couple months ago. Thank you!!!
No problem at all! A bit lamp should be ideal for your application. That’s the object I tested here in office. If you have any more questions, just let us know!