Reading blocks of data from TrioPC Motion ActiveX or DLL

Reading blocks of data from TrioPC Motion ActiveX or DLL

The ActiveX and DLL have a way to read blocks of data. The method is called PRMBLK. If you look at he help, it shows you the list.


You need to define the type of block you want to read, for example DefineSystem would be used to read system values such as Ain. Then use Append to add another value and again to add another. Once set up PRMBLK_Get will read the block for you. Here is an example from VB.

Private Sub GetParam_Click(sender As Object, e As EventArgs) Handles GetParam.Click
Dim result As Boolean
Dim i As Integer
Dim ret_values As Object

TrioPC1.PRMBLK_DefineAxis(0, "DPOS")
TrioPC1.PRMBLK_Append(0, "MPOS")
TrioPC1.PRMBLK_Append(0, "IDLE")

ret_values = Nothing
result = TrioPC1.PRMBLK_GetAxis(0, 1, True, ret_values)
If result = False Then
tc = tc + 1
End If
Terminal.AppendText(ret_values(0).ToString & vbCrLf)
Terminal.AppendText(ret_values(1).ToString & vbCrLf)
Terminal.AppendText(ret_values(2).ToString & vbCrLf)


And for AIN:
result = TrioPC1.PRMBLK_DefineSystem(1, "AIN0")
result = TrioPC1.PRMBLK_Append(1, "AIN1")
result = TrioPC1.PRMBLK_Append(1, "AIN2")
result = TrioPC1.PRMBLK_Append(1, "AIN3")

ret_values = Nothing
result = TrioPC1.PRMBLK_Get(1, True, ret_values)
If result = False Then
tc = tc + 1
End If

Terminal.AppendText(ret_values(0).ToString & vbCrLf)
Terminal.AppendText(ret_values(1).ToString & vbCrLf)
Terminal.AppendText(ret_values(2).ToString & vbCrLf)

    • Related Articles

    • Is there some method to use a .dll into MC4N-ECAT?

      You cannot import a DLL into the MC4N-ECAT. It has a BASIC compiler and IEC-61131-3 Compiler. The Operating System is a special Trio designed OS with large motion library. If you connect a PC to the MC4N-ECAT using Ethernet, then you can install a ...
    • ActiveX: Get controller details

      This sample of code is from a Visual Basic Program.  It reads system variables from the Motion Coordinator after the TrioPC Motion ActiveX/DLL connection is opened.         Dim d_value As Double         Dim l_value As Long         ...
    • AN-375 Trio PCMOTION ActiveX Ethernet Response time

      When planning a network and the communication links between devices, the available response time is often needed to allow the system designer to work out how much data can be transferred. System critical data may need to be written or read in a known ...
    • Motion Perfect problem when SCOPE command is used

      When running the SCOPE command in a program, I think Motion Perfect doesn't like the SCOPE command being issued over and over when I run it. It seems more stable when I comment the SCOPE command out after it's ran once. ...
    • AN-304 Adding TrioPC to Visual Basic

      A connection between a Windows PC and a Motion Coordinator can be made with an ActiveX component called TrioPC Motion. The ActiveX component must be added to the Visual Basic project. This document describes this step by step. The example is based on ...