Beispiel #1
0
        private void Poll()
        {
            double   nidbuff = double.MaxValue;
            DateTime dt      = DateTime.Now;

            while (!bExit)
            {
                if (ReadCount - ChartCount < 99 && !Pause)
                {
                    byte[] data = sc.GetAppdata();

                    double nid = (DateTime.Now - dt).TotalSeconds;
                    if (!GetDataByTime)
                    {
                        nid = StaubliXML.GetXMLDouble("nID", StaubliXML.Byte2xd(data));
                    }
                    double nSpeed = StaubliXML.GetXMLDouble("nRobotSpeed", StaubliXML.Byte2xd(data));

                    if (nid != nidbuff && nid > 0)
                    {
                        nidbuff = nid;

                        speeddata[ReadCount % 100, 0] = nid;
                        speeddata[ReadCount % 100, 1] = nSpeed;
                        ReadCount++;
                    }
                }
                System.Threading.Thread.Sleep(polltime);
            }
        }
Beispiel #2
0
        private void Poll()
        {
            double   nidbuff = double.MaxValue;
            DateTime dt      = DateTime.Now;

            while (!bExit)
            {
                if (ReadCount - ChartCount < 99 && !Pause)
                {
                    byte[] data = sc.GetAppdata();

                    double nid = (DateTime.Now - dt).TotalSeconds;
                    if (!GetDataByTime)
                    {
                        nid = StaubliXML.GetXMLDouble("nID", StaubliXML.Byte2xd(data));
                    }
                    double[] nJointForce = StaubliXML.GetXMLDoubleArray("nJointForce", StaubliXML.Byte2xd(data));

                    if (nid != nidbuff && nid > 0)
                    {
                        nidbuff = nid;

                        speeddata[ReadCount % 100, 0] = nid;
                        if (nJointForce == null)
                        {
                            nJointForce = new double[6];
                        }
                        for (int i = 0; i < nJointForce.Length; i++)
                        {
                            speeddata[ReadCount % 100, 1 + i] = nJointForce[i];
                        }

                        ReadCount++;
                    }
                }
                System.Threading.Thread.Sleep(polltime);
            }
        }