LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Compumotor 6K FastStatus through Com6Srvr

Solved!
Go to solution

I am in need of some help to read FastStatus values from a Compumotor 6K.  I have motion program loaded and running in the 6K and I would like to read some of the Variable that I have created.  The Variables are Var1 to Var12 and Vari1 to Vari10.  I have a vi running that will read the variables using the Write and Read functions of the Com6Srvr and the returned values are all correct.  However I would like to perform the reads using the FastStatus capabilites of the Com6Srvr.  Now I have read all the information that was provide and there are two ways to read the data.  One is using the VAR method or EXFastStatus.  So I started with the VAR method as it is the easiest.  I setup the Connect2 to use imode=2 and then use VAR with 1 as my varnum input.  The value that is returned is 39.43, however this value is wrong.  Using motion planner terminal or the Write and Read functions the value is 1.  I have tried other varnum's and they all return the wrong numbers.  I have tried the VARI method and they return nothing but 0.

 

Ultimately I would like to use the EXFastStatus to retrive all the information in one command.

 

Does anyone have any experience using the Com6Srvr, in particular the FastStatus in Labview?

 

Here is the test I created to read the VAR value

 

FastStatus Var read.jpg

 

Any help would be great.  Also the Compumotor 6K VI Motion Library from Viewpoint systems is discontinued so I need to develop this from scratch.

 

Thanks

 

Terry

0 Kudos
Message 1 of 9
(3,452 Views)
Solution
Accepted by topic author Terry_S

Right after sending this post I got a reply back from Compumotor and the problem was I had the wrong class selected in the Com6Srvr. I was using the Com6Srvr.INet when I should have been using the Com6Srvr.Gem6K.

 

All is now working correctly.

0 Kudos
Message 2 of 9
(3,439 Views)

For whatever it's worth - you can also use the direct ethernet mode of the 6K. Several years ago I started a project using Com6Server, and eventually found that I got better performance by parsing the TCP packets in my code. I do have that code sitting around somewhere and can try to dig it up if you'd like. There's documentation here: http://www.parkermotion.com/manuals/6k/6k_manuals.htm#Ethernet although the ethernet spec is poorly worded.

0 Kudos
Message 3 of 9
(3,415 Views)

Nathand,

 

I would be interested in the code if you have it available.  Better performance is what I am trying to achieved.  I started just using the Write and Read functions in ComSrvr, but my application slowed down due to the number of calls.  Now I am trying the FastStatus.

 

If you have some experience with this, would you be able to give me some direction and how I go about converting the Variant the is returned from the FastStatus call.  The manual shows me what the packet looks like (the 280 bytes is wrong, it is actual 284 bytes).  See below:

 

FastStatus Packet.jpg

 

Thanks

Terry

0 Kudos
Message 4 of 9
(3,389 Views)

As I mentioned, I gave up on the Com6Srvr, and decided to use the direct ethernet mode instead. However, I'm guessing that the FastStatus data is similar or identical to the raw status data received directly over ethernet, since the descriptions look similar. The trick is to get the variant into some usable form first. You'll need to use Variant to Data. I would first try using, as a type input, a cluster similar to the "Status Packet" type definition attached here. You might even be able to use that cluster directly, although your screenshot from the manual shows a few more fields at the end. Also wire the error out of Variant to Data so you can easily see if there's an error. If that doesn't work, try wiring a string constant as the type input, then typecast to the cluster (as shown in the image below). If that doesn't work too, try an array of U8 as the type input and typecast that. If that still doesn't work, attach your code and post the error description.

ReadFrom6k4.png

 

Your application is likely quite different than mine, but here's what I found gave me the best performance:

I wrote a bunch of 6k4 programs, each of which is saved on the controller and runs a different part of the machine (for the most part this is one program per axis since each axis is an independent motor with no coordinated motion). Each program is configured to run when a certain input goes high. Those inputs are mapped to boolean variables. To trigger a program to run, the LabVIEW code sends a raw packet which includes an updated value of the boolean variable, with the appropriate bit set to 1. I use the 6k alarms (interrupts) which automatically send a status packet when triggered. The programs trigger a software alarm as the first statement, providing confirmation that the command was received, and then trigger a hardware alarm (using the Motion Complete event) when they finish. The LabVIEW code sees the status packets generated by these alarms and can track the 6k state.

Message 5 of 9
(3,371 Views)

Thanks for the suggestions.  In the end I ended up type casting the variant to a U8 array and indexed through the array to convert the various parts to I32 and Double (VAR are doubles).

 

Terry.

0 Kudos
Message 6 of 9
(3,338 Views)

Hi Nathan,

 

I would be interested on your code to use direct Ethernet mode with the 6K. I have run out of patience with the Com6Srvr. Parker is unwilling to make it work with something other than Windows XP.

Thank you for your help.

 

Alejandro Andreatta

0 Kudos
Message 7 of 9
(2,913 Views)

Here's a ZIP of the files pertaining to the 6k4 from my project. I wrote this code nearly a decade ago, so this code is in LabVIEW 2009. If you can't open it, I might be able to save it in something newer. Since this is extracted from a much larger project, it will be missing a lot of type definitions and possibly other files, and most of the logic will be meaningless without the context of that application, but I think you'll be able to see how the TCP read and write to the 6k4 works. It sends and receives binary packets in accordance with the documentation. There's also a VI here that I used for downloading programs to the 6k4.

Message 8 of 9
(2,906 Views)

Hi Nathan,

 

Thank you for sharing the code. I'll post more after I use it.

 

Alejandro

0 Kudos
Message 9 of 9
(2,898 Views)