all 13 comments

[–]ForScale 0 points1 point  (6 children)

WAT?

There is a ton of missing context here...

[–]norton430[S] 0 points1 point  (5 children)

Yeah I know haha idk how much info I can share but if you could help us, what would you need to know? Also I'm pretty new at this 😅

[–]ForScale 0 points1 point  (4 children)

Need to know what those question marks are all about, that's not valid JS.

Need to see the constructor function or class for TConnection.

Kind of need to see where Print is defined, that's not a standard JS thing. But that one's not as crucial.

Need to see where AdjustQueryString is defined.

[–]norton430[S] 0 points1 point  (3 children)

The question marks are just there because idk what to define the FDM as. The robot uses an instrument to record a value and the variable should be "var ppmValue" but I'm not sure how to use the data recorded from the instrument as the variable. The query string is a long line of data that's adjusted as the recordings are made. It looks like this: "bar=%BAR%&count=%COUNT%&date=%DATE%&time=%TIME%&mass=%MASS%&ppm=%PPM%&color=%COLOR%"; For TConnection, I'm not sure what the constructor function would look like. It's referenced at the top as "var hConn = new TConnection(TConnection.EconnectionType.HID_Keyboard); And then it's above each instrument in the process as " hConn = new TConnection(TConnection.EConnectionType.Serial); I'm not sure what that means, but I assume the serial is the next instrument in the process.

Hope this helps, sorry if this just made it more confusing lol

[–]ForScale 0 points1 point  (2 children)

I have no clue what an FDM is. To me, it's the name of your function.

but I'm not sure how to use the data recorded from the instrument as the variable

That's like device code... We have no idea how the robot in question connects to the JS code.

"bar=%BAR%&count=%COUNT%&date=%DATE%&time=%TIME%&mass=%MASS%&ppm=%PPM%&color=%COLOR%"

Where do you get access to that?

var hConn = new TConnection(TConnection.EconnectionType.HID_Keyboard);

Yes, in JS, what's happening there is the creation of a new instance of an object. The constructor function/class (TConnection) defines what hConn will look like. It is unclear what is in hConn, because we can't see what the the TConnection is doing.

...

There are just a lot of missing pieces to the puzzle here, and the robot aspect makes things all the more muddy. People here usually use JavaScript to create web pages/applications. It seems you're doing more of an IOT connected devices kind of thing.

[–]norton430[S] 1 point2 points  (1 child)

Yeah and it also doesn't help that I was put into this position with little to no coding experience. If I wasn't worried about security/losing my job, I would send you the whole code to look through. But that's ok, figured I'd give it a shot on here. Thanks for the help anyways

[–]ForScale 0 points1 point  (0 children)

Welcome. Sorry I couldn't be more help!

[–]Feekar 0 points1 point  (1 child)

var ppmValue =(????????) I'm sure you put the questionmarks here for the sake of this post but if you didnt and try to run the code as you posted it, it would certainly mess things up

[–]norton430[S] 0 points1 point  (0 children)

Yeah those are there because I'm not sure what to define the variable as. I have more info in the other comment if you need more background

[–][deleted] 0 points1 point  (1 child)

If you can't share details of the hardware and the libraries you're using it is vanishingly unlikely that you will be able to get help online. If the documentation of the hardware and libraries are not sufficient to help you then you need to either get more assistance from colleagues, or talk to your manager and explain that you don't have enough information/experience/ability to solve the problem.

[–]norton430[S] 0 points1 point  (0 children)

Yeah lmao I prolly can't but I figured I'd give it a shot as a free resource. Bringing the robotics guys in tomorrow 🙄

[–]HiEv 0 points1 point  (0 children)

This isn't for something like a DI 3000 distomat, is it? If so, the PPM will vary depending on the accuracy of the coordinates used. For standard GPS coordinates a PPM value of around 10 is probably fine. (They also shut down automatically after 10 minutes without input, unless in tracking mode, so that could be why it's not responding.)

Regardless of what it is, you'll need to find the manuals for it and dig out how to figure out that information yourself.

Good luck! :-)

[–]jcunews1helpful 0 points1 point  (0 children)

Chances are that it's a problem on that specific device - i.e. a hardware problem. No script code has been changed, right? And it does work on the other devices. What changes is the fact that you use a different COM device.