News:

  • September 29, 2023, 05:16:19 PM

Login with username, password and session length

Author Topic: H0-CTRIO2 Examples  (Read 5565 times)

agsweeney

  • Newbie
  • *
  • Posts: 4
H0-CTRIO2 Examples
« on: July 31, 2014, 02:37:55 PM »
Why are there not any decent examples using iboxes posted anywhere?

I bought the manual and I have gotten several things working but something as simple as "load a dynamic position plus" from an ibox and then send the position is not clear.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 5922
  • Yes Pinky, Do-more will control the world!
Re: H0-CTRIO2 Examples
« Reply #1 on: July 31, 2014, 04:38:03 PM »
Well...my favorite answer to this issue is Do-more. But I'll have somebody dump some knowledge on you here shortly. I'm sure the info exists, but the manual is...um...not ADC's best effort.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

Greg

  • HostTech
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 668
  • Why for you bury me in the cold, cold ground?
    • Host Engineering, Inc.
Re: H0-CTRIO2 Examples
« Reply #2 on: July 31, 2014, 04:50:13 PM »
At http://www.hosteng.com/FAQFiles/CTRIO.htm#FAQ0054 you can download some CTRIO flowcharts in PDF format that should help you.
There are two types of people in the world; those that can extrapolate from incomplete data sets.

agsweeney

  • Newbie
  • *
  • Posts: 4
Re: H0-CTRIO2 Examples
« Reply #3 on: July 31, 2014, 09:57:00 PM »
Well...my favorite answer to this issue is Do-more. But I'll have somebody dump some knowledge on you here shortly. I'm sure the info exists, but the manual is...um...not ADC's best effort.

I will be looking at Do-More for the next version of the machine (2x size) but for now I'm stuck with this DL06/H0-CTRIO2 combo to drive my ball screws.

Loading and running a static pulse profile or homing either or both axis with dual prox style homing works great.

My issue stemmed from needing variables keyed in via a c-more micro (tool length offset + groove depth - wood thickness) to tell my stepper how far to move my 16hp spindle motor.

Searching online for examples was all but useless.

@Greg - Thanks I will try to make something work tomorrow using the flow charts as a guide. 

agsweeney

  • Newbie
  • *
  • Posts: 4
Re: H0-CTRIO2 Examples
« Reply #4 on: August 01, 2014, 09:45:28 AM »
Well...my favorite answer to this issue is Do-more. But I'll have somebody dump some knowledge on you here shortly. I'm sure the info exists, but the manual is...um...not ADC's best effort.

I will be looking at Do-More for the next version of the machine (2x size) but for now I'm stuck with this DL06/H0-CTRIO2 combo to drive my ball screws.

Loading and running a static pulse profile or homing either or both axis with dual prox style homing works great.

My issue stemmed from needing variables keyed in via a c-more micro (tool length offset + groove depth - wood thickness) to tell my stepper how far to move my 16hp spindle motor.

Searching online for examples was all but useless.

@Greg - Thanks I will try to make something work tomorrow using the flow charts as a guide. 


@Greg,

Can you look at this and tell me where i am going wrong? It will move, but never stops (until limit SW is tripped).

Code: [Select]
PLC 06

// Rung 1
// Address 0
CTRIO K1 K1 V400 K0 V3000 B3020.0 V3030 B3054.0

// Rung 2
// Address 49
#BEGIN COMMENT
"Load the Trap Plus file using encoder for position."
"Values for the IB-541 result V5000 would come from the C-More Micro V4151, V4153, "
"V4155 vales. These are test numbers only."
""
#END
STRPD X1
CTRLDPR K1 K0 K3 V400 C100 C101
MATHR V5000 "(R10.625 + R0.375) - R3.25"

// Rung 3
// Address 162
STR C100
LDD V5000
OUTD V3030
SET B3056.0

// Rung 4
// Address 167
STR B3022.0
ANDN B3022.4
OR X20
RST B3056.0

// Rung 5
// Address 174
NOP

// Rung 6
// Address 175
END

// Rung 7
// Address 176
NOP


#BEGIN ELEMENT_DOC
"X20","","","OVER LIMIT SW"
"C100","","","Load Profile Success"
"V2000","C1F1_ScldUnit_1","Scaled Units",""
"V2002","C1F1_RawValue_1","Raw Value",""
"V2030","Out0_Param3_1","Parameter 3",""
"V2040","Out0_CmdCode_1","Command Code",""
"V2041","Out0_Param1_1","Parameter 1",""
"V2042","Out0_Param2_1","Parameter 2",""
"V3000","C1F1_ScldUnit_2","Scaled Units",""
"V3002","C1F1_RawValue_2","Raw Value",""
"V3030","Out0_Param3_2","Parameter 3",""
"V3040","Out0_CmdCode_2","Command Code",""
"V3041","Out0_Param1_2","Parameter 1",""
"V3042","Out0_Param2_2","Parameter 2",""
"B2020.1","C1F1_AtRstVal_1","At Reset Value",""
"B2022.0","Out0_OutEnbld_1","Output Enabled",""
"B2022.1","Out0_PosLoded_1","Position Loaded",""
"B2022.2","Out0_OutSuspd_1","Output Suspended",""
"B2022.4","Out0_OutActiv_1","Output Active",""
"B2022.5","Out0_OutStald_1","Output Stalled",""
"B2022.6","Out0_CmdError_1","Cmd Error",""
"B2022.7","Out0_CmdCmplt_1","Cmd Complete",""
"B2024.6","SysCmdError_1","SysCmd Error",""
"B2024.7","SysCmdComplet_1","SysCmd Complete",""
"B2025.0","Ch1A_1","Ch1 A",""
"B2025.1","Ch1B_1","Ch1 B",""
"B2025.2","Ch1C_1","Ch1 C",""
"B2025.3","Ch1D_1","Ch1 D",""
"B2025.8","Out0_Active_1","Out 0 Active",""
"B2025.9","Out0_Mode_1","Out 0 Mode",""
"B2025.10","Out1_Active_1","Out 1 Active",""
"B2025.11","Out1_Mode_1","Out 1 Mode",""
"B2054.1","C1F1_Reset_1","Reset",""
"B2056.0","Out0_EnablOut_1","Enable Output",""
"B2056.1","Out0_GotoPos_1","Goto Position",""
"B2056.2","Out0_SuspOut_1","Suspend Output",""
"B2056.4","Out0_Dirction_1","Direction",""
"B2056.7","Out0_ProcCmd_1","Process Cmd",""
"B2060.7","ProcSysCmd_1","Process SysCmd",""
"B3020.1","C1F1_AtRstVal_2","At Reset Value",""
"B3022.0","Out0_OutEnbld_2","Output Enabled",""
"B3022.1","Out0_PosLoded_2","Position Loaded",""
"B3022.2","Out0_OutSuspd_2","Output Suspended",""
"B3022.4","Out0_OutActiv_2","Output Active",""
"B3022.5","Out0_OutStald_2","Output Stalled",""
"B3022.6","Out0_CmdError_2","Cmd Error",""
"B3022.7","Out0_CmdCmplt_2","Cmd Complete",""
"B3024.6","SysCmdError_2","SysCmd Error",""
"B3024.7","SysCmdComplet_2","SysCmd Complete",""
"B3025.0","Ch1A_2","Ch1 A",""
"B3025.1","Ch1B_2","Ch1 B",""
"B3025.2","Ch1C_2","Ch1 C",""
"B3025.3","Ch1D_2","Ch1 D",""
"B3025.8","Out0_Active_2","Out 0 Active",""
"B3025.9","Out0_Mode_2","Out 0 Mode",""
"B3025.10","Out1_Active_2","Out 1 Active",""
"B3025.11","Out1_Mode_2","Out 1 Mode",""
"B3054.1","C1F1_Reset_2","Reset",""
"B3056.0","Out0_EnablOut_2","Enable Output",""
"B3056.1","Out0_GotoPos_2","Goto Position",""
"B3056.2","Out0_SuspOut_2","Suspend Output",""
"B3056.4","Out0_Dirction_2","Direction",""
"B3056.7","Out0_ProcCmd_2","Process Cmd",""
"B3060.7","ProcSysCmd_2","Process SysCmd",""

#END

Greg

  • HostTech
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 668
  • Why for you bury me in the cold, cold ground?
    • Host Engineering, Inc.
Re: H0-CTRIO2 Examples
« Reply #5 on: August 01, 2014, 04:06:35 PM »
agsweeney, at first glance it appears you are putting a Real number in Parameter 3 (the position you are going to). According to your MATHR IBox that value is 7.75. But the thing is, Parameter 3 position is not a Real number. So when the MATHR stuffs 32-bits into V5000-V5001 it will be in floating-point format but the CTRIO2 will interpret that as a 32-bit signed integer.

V5000-5001:
  • 7.75 (Real)
  • 1,089,994,752 (32-bit signed integer)

So, if it seems to run forever that is because it is trying to get to an encoder count of 1.1 billion. That's pretty big and my guess is that's not what you intended.
There are two types of people in the world; those that can extrapolate from incomplete data sets.

agsweeney

  • Newbie
  • *
  • Posts: 4
Re: H0-CTRIO2 Examples
« Reply #6 on: August 01, 2014, 09:08:50 PM »
agsweeney, at first glance it appears you are putting a Real number in Parameter 3 (the position you are going to). According to your MATHR IBox that value is 7.75. But the thing is, Parameter 3 position is not a Real number. So when the MATHR stuffs 32-bits into V5000-V5001 it will be in floating-point format but the CTRIO2 will interpret that as a 32-bit signed integer.

V5000-5001:
  • 7.75 (Real)
  • 1,089,994,752 (32-bit signed integer)

So, if it seems to run forever that is because it is trying to get to an encoder count of 1.1 billion. That's pretty big and my guess is that's not what you intended.

Thank you.

After talking with a guy in support I realized my error and converted the real number to binary and all is well.