the microseconds

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, LCMark

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3311
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: the microseconds

Post by mwieder » Wed Sep 16, 2020 10:45 pm

Ah. Did you not expect a fractional part? That's the whole point of the "long" variation.

mrcoollion
Posts: 614
Joined: Thu Sep 11, 2014 1:49 pm
Location: The Netherlands

Re: the microseconds

Post by mrcoollion » Thu Sep 17, 2020 8:19 am

mwieder wrote:
Wed Sep 16, 2020 10:45 pm
Ah. Did you not expect a fractional part? That's the whole point of the "long" variation.
Wel AxWald mentioned
9.6/ 64bit: They show no fractional part at all
in Windows 10. That why I wanted to test it myself.

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3311
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: the microseconds

Post by mwieder » Thu Sep 17, 2020 4:08 pm

Ha! :idea: I get it now. So there is indeed cross-platform parity for "the long milliseconds". Thanks.

Bernard
Posts: 348
Joined: Sat Apr 08, 2006 10:14 pm
Location: London, England

Re: the microseconds

Post by Bernard » Mon Oct 19, 2020 12:05 am

I'm not sure that "the long milliseconds" returns anything of any value. For example, whenever it shows a fractional part to me, the fraction always has this value: ".000244" .

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3311
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: the microseconds

Post by mwieder » Mon Oct 19, 2020 12:14 am

What OS? I'm guessing Windows, where I would pretty much guarantee it not to work, given the system calls that are being made.

Bernard
Posts: 348
Joined: Sat Apr 08, 2006 10:14 pm
Location: London, England

Re: the microseconds

Post by Bernard » Thu Oct 22, 2020 12:46 am

Yep. Windows 10.

Monox18
Posts: 89
Joined: Tue Nov 25, 2014 9:48 pm
Location: Deggendorf, Germany

Re: the microseconds

Post by Monox18 » Mon Jan 04, 2021 12:26 am

dunbarx wrote:
Tue Sep 15, 2020 10:26 pm
I have a friend who would love to use LC to control a homeMade CNC milling machine. He uses assembly language now, because he cannot get LC accurately to know what time it is. The milliseconds don't cut it.
Craig
You can use LC to control a CNC for sure, but LC wouldn't be doing the dirty low level stuff.

I once made a mobile app with LC to control 2 robotic arms from different brands. Like a remote controller, I could move them in XYZ or Joint coordenates. Both arms had different ways of being controlled. To one of them I had to send Ethernet commands, while to the other I had to send COM commands. LC isn't directly controlling the servos, doing PWM, managing voltages and so on. Both robotic arms have a dedicated hardware. That hardware takes care of servo manipulation and PID control. From LC I can even change PID values, modify speeds and basicallly modify any setting I want. But in the end, the dedicated hardware is the one who is going to controls the motors, not LC.

LCMark explained some of the reasons of why a "multi-user, pre-emptive multi-thread/process systems" is not suitable for the job, in this case very time-precise motor controlling, and instead you need a single thread system such as a microcontroller, (or FPGA for more complex projects).

In the case of your friend's home made CNC, since it is homemade I guess he is using some sort of microcontroller, like an Arduino. Micros are very cheap and suited for the task. He could write the low level stuff, burn it to the microcontroller. Then from LC build the GUI and call some scripts/commands via communications protocols. One example: he could save the G-Code commands for mechanizing the piece in the CNC into the hardware, and then from LC calling/stopping scheduling them, measuring progress, etc.
Monox
Developing a Cyber Physical System.
https://www.monoxware.com/

Post Reply

Return to “Engine Contributors”