ni-motion vi helpthis help file provides a comprehensive reference of all ni-motion virtual...
TRANSCRIPT
NI-Motion™VIHelpJuly2007,370537H-01
ThishelpfileprovidesacomprehensivereferenceofallNI-MotionVirtualInstruments(VIs).ThisdocumentisintendedforusebydevelopersofNI-MotionsystemswithaworkingknowledgeofLabVIEW.
Formoreinformationaboutthishelpfile,refertothefollowingtopics:
UsingHelp
RelatedDocumentation
Glossary
ImportantInformation
TechnicalSupportandProfessionalServices
TocommentonNationalInstrumentsdocumentation,refertotheNationalInstrumentsWebsite.
©1999–2007NationalInstrumentsCorporation.Allrightsreserved.
UsingHelpConventions
NavigatingHelp
SearchingHelp
PrintingHelpFileTopics
ConventionsThishelpfileusesthefollowingformattingandtypographicalconventions:
<>Anglebracketsthatcontainnumbersseparatedbyanellipsisrepresentarangeofvaluesassociatedwithabitorsignalname—forexample,AO<0..3>.
[] Squarebracketsencloseoptionalitems—forexample,[response].
»
The»symbolleadsyouthroughnestedmenuitemsanddialogboxoptionstoafinalaction.ThesequenceFile»PageSetup»OptionsdirectsyoutopulldowntheFilemenu,selectthePageSetupitem,andselectOptionsfromthelastdialogbox.Thisicondenotesatip,whichalertsyoutoadvisoryinformation.Thisicondenotesanote,whichalertsyoutoimportantinformation.Thisicondenotesacaution,whichadvisesyouofprecautionstotaketoavoidinjury,dataloss,orasystemcrash.
boldBoldtextdenotesitemsthatyoumustselectorclickinthesoftware,suchasmenuitemsanddialogboxoptions.Boldtextalsodenotesparameternames.
darkred Textinthiscolordenotesacaution.
green Underlinedtextinthiscolordenotesalinktoahelptopic,helpfile,orWebaddress.
italicItalictextdenotesvariables,emphasis,cross-references,oranintroductiontoakeyconcept.Italictextalsodenotestextthatisaplaceholderforawordorvaluethatyoumustsupply.
monospace
Textinthisfontdenotestextorcharactersthatyoushouldenterfromthekeyboard,sectionsofcode,programmingexamples,andsyntaxexamples.Thisfontisalsousedforthepropernamesofdiskdrives,paths,directories,programs,subprograms,subroutines,devicenames,functions,operations,variables,filenames,andextensions.
NavigatingHelp(WindowsOnly)Tonavigatethishelpfile,usetheContents,Index,andSearchtabstotheleftofthiswindoworusethefollowingtoolbarbuttonslocatedabovethetabs:
Hide—Hidesthenavigationpanefromview.Locate—LocatesthecurrentlydisplayedtopicintheContentstab,allowingyoutoviewrelatedtopics.Back—Displaysthepreviouslyviewedtopic.Forward—DisplaysthetopicyouviewedbeforeclickingtheBackbutton.Options—Displaysalistofcommandsandviewingoptionsforthehelpfile.
SearchingHelp(WindowsOnly)UsetheSearchtabtotheleftofthiswindowtolocatecontentinthishelpfile.Ifyouwanttosearchforwordsinacertainorder,suchas"relateddocumentation,"addquotationmarksaroundthesearchwordsasshownintheexample.SearchingfortermsontheSearchtaballowsyoutoquicklylocatespecificinformationandinformationintopicsthatarenotincludedontheContentstab.
Wildcards
Youalsocansearchusingasterisk(*)orquestionmark(?)wildcards.Usetheasteriskwildcardtoreturntopicsthatcontainacertainstring.Forexample,asearchfor"prog*"liststopicsthatcontainthewords"program,""programmatically,""progress,"andsoon.
Usethequestionmarkwildcardasasubstituteforasinglecharacterinasearchterm.Forexample,"?ext"liststopicsthatcontainthewords"next,""text,"andsoon.
NoteWildcardsearchingwillnotworkonSimplifiedChinese,TraditionalChinese,Japanese,andKoreansystems.
NestedExpressions
Usenestedexpressionstocombinesearchestofurtherrefineasearch.YoucanuseBooleanexpressionsandwildcardsinanestedexpression.Forexample,"exampleAND(programORVI)"liststopicsthatcontain"exampleprogram"or"exampleVI."Youcannotnestexpressionsmorethanfivelevels.
BooleanExpressions
Clickthe buttontoaddBooleanexpressionstoasearch.ThefollowingBooleanoperatorsareavailable:
AND(default)—Returnstopicsthatcontainbothsearchterms.Youdonotneedtospecifythisoperatorunlessyouareusingnestedexpressions.OR—Returnstopicsthatcontaineitherthefirstorsecondterm.NOT—Returnstopicsthatcontainthefirsttermwithoutthesecondterm.NEAR—Returnstopicsthatcontainbothtermswithineightwordsofeachother.
SearchOptions
UsethefollowingcheckboxesontheSearchtabtocustomizeasearch:
Searchpreviousresults—Narrowstheresultsfromasearchthatreturnedtoomanytopics.Youmustremovethecheckmarkfromthischeckboxtosearchalltopics.Matchsimilarwords—Broadensasearchtoreturntopicsthatcontainwordssimilartothesearchterms.Forexample,asearchfor"program"liststopicsthatincludethewords"programs,""programming,"andsoon.Searchtitlesonly—Searchesonlyinthetitlesoftopics.
PrintingHelpFileTopics(WindowsOnly)CompletethefollowingstepstoprintanentirebookfromtheContentstab:
1. Right-clickthebook.2. SelectPrintfromtheshortcutmenutodisplaythePrintTopicsdialogbox.3. SelectthePrinttheselectedheadingandallsubtopicsoption.
NoteSelectPrinttheselectedtopicifyouwanttoprintthesingletopicyouhaveselectedintheContentstab.
4. ClicktheOKbutton.
PrintingPDFDocuments
ThishelpfilemaycontainlinkstoPDFdocuments.ToprintPDFdocuments,clicktheprintbuttonlocatedontheAdobeAcrobatViewertoolbar.
AxesAnaxisconsistsofatrajectorygenerator,PIDorsteppercontrolblock,andsomesortofoutputresource,eitheradigital-to-analogconverter(DAC)outputorastepperpulsegeneratoroutput.Servoaxesmustalsohavesomesortoffeedbackresource,eitheranencoderorADCchannel.Closed-loopstepperaxesalsorequireafeedbackresource,andcanuseeitherencoderorADCinputs.Open-loopstepperaxesdonotrequirefeedbackforcorrectoperation.ThefollowingtableliststheresourceIDsforaxes:
ResourceName ResourceIDAxisControl 0x00(0)Axis1 0x01(1)Axis2 0x02(2)Axis3 0x03(3)Axis4 0x04(4)Axis5 0x05(5)Axis6 0x06(6)Axis7 0x07(7)Axis8 0x08(8)Axis9 0x09(9)Axis10 0x0A(10)Axis11 0x0B(11)Axis12 0x0C(12)Axis13 0x0D(13)Axis14 0x0E(14)Axis15 0x0F(15)
VIsthatcanoperateonmultipleaxessimultaneously(forexample,ReadBlendStatusandStartMotion)cantaketheaxiscontrol(0)astheirresourceparameter.
UsingAxesNineThroughFifteen
Completethefollowingstepstouseaxesninethroughfifteen:
1. OpenthedesiredVIinLabVIEW.2. Viewtheblockdiagram.3. Right-clicktheappropriateterminalandselectCreate»Constant.4. Clickthedrop-downarrowontheconstantandselectOther.5. Typetheselectedaxisnumber(indecimal)foraxesninethroughfifteen.
VectorSpacesVectorspacesarelogical,multidimensionalgroupsofaxes.Theycanbeeitherone-dimensional,two-dimensionalwithxandyaxes,orthree-dimensionalwithx,y,andzaxes.ThetotalnumberofvectorspacesNI-Motionsupportsinyourmotioncontrolsystemcanbecalculatedusingthefollowingformula:
totalvectorspaces= .
Vectorspacesfacilitate2Dand3Dinterpolatedmoves:linear,circular,helical,andspherical.YoucansendavectorspacetomanyNI-MotionVIstodefinevectorposition,vectorvelocity,vectoracceleration,andsoon.
Vectorspacesarestarted,stopped,andcontrolledasiftheywereasingleaxis,greatlysimplifyingthecontrolofcoordinatedvectoraxes.Allaxesinavectorspacestartandstopatthesametime,completingthevectormotionprofilesprogrammed.ThefollowingtableliststheresourceIDsforvectorspacecontrol.
ResourceName ResourceIDVectorSpaceControl 0x10(16)VectorSpace1 0x11(17)VectorSpace2 0x12(18)VectorSpace3 0x13(19)VectorSpace4 0x14(20)VectorSpace5 0x15(21)VectorSpace6 0x16(22)VectorSpace7 0x17(23)VectorSpace8 0x18(24)
VIsthatcanoperateonmultiplevectorspacessimultaneously(forexample,StartMotion)cantakethevectorspacecontrol(0x10)astheirresourceparameter.
VectorspacesareconfiguredbymappingaxestothevectorspacewiththeConfigureVectorSpaceVI.Vectorspacesarelogical,notphysical,anddonot
requiremotionresourcesotherthanthoseusedbytheaxesthemselves.
UsingVectorSpacesFiveThroughEight
Completethefollowingstepstousevectorspacesfivethrougheight:
1. OpenthedesiredVIinLabVIEW.2. Viewtheblockdiagram.3. Right-clicktheappropriateterminalandselectCreate»Constant.4. Clickthedrop-downarrowontheconstantandselectOther.5. Typetheselectedvectorspacenumber(indecimal)forvectorspacesfive
througheight.
MotionResourcesTherearefourtypesofmotionresourcesontheNI-Motioncontroller:encoders,ADCchannels,DACoutputs,andstepperoutputs.Ingeneral,VIsrelatingtomotionresources(forexample,ReadDACandReadStepsGenerated)canbesenttotheresourceortheaxistheresourceismappedto.
NoteAftertheyaremappedtoanaxis,allfeaturesandfunctionsofamotionresourceareavailableaspartoftheaxis.Itisnotnecessarytorememberorusetheresourcenumberdirectlywhenaccessingthesefeaturesaspartoftheaxis.Resourcesarereferencedbyaxisnumberaftertheyareassignedtothataxis.
NI73xxControllerConsiderations
Thefollowinglistincludesconsiderationsyoumustmakewhenyouareusingtheseresourceswitha73xxcontroller:
7330controllersdonotsupportDACoutputsorsecondaryADCs.7340controllersdonotsupportsecondaryADCs.7350controllerssupportasecondaryfeedbackdeviceoneachaxis.7390controllersdonotsupportADCchannels,DACoutputs,secondaryADCs,orsecondaryencoders.
NISoftMotionControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingtheseresourceswiththeNISoftMotionController:
TheNISoftMotionControllersupportsasecondaryfeedbackdeviceoneachaxis.
SecondaryEncodersUsesecondaryencodersinadual-loopfeedbacksystemtoprovideamoreaccuratevelocityfeedbackestimation.
ResourceName ResourceIDSecondaryEncoder1 0X71(113)SecondaryEncoder2 0X72(114)
.
.
.SecondaryEncoder15 0X7F(127)SecondaryADCs
UsesecondaryADCsinadual-loopfeedbacksystemtoprovideamoreaccuratevelocityfeedbackestimation.
ResourceName ResourceIDSecondaryADC1 0X91(145)SecondaryADC2 0X92(146)
.
.
.SecondaryADC15 0X9F(159)
EncodersEncoderresourcesareprimarilyusedforpositionfeedbackonservoandclosed-loopstepperaxes.Whenencoderresourcesarenotmappedtoanaxisforuseasaxisfeedback,youcanusethemforanynumberofotherfunctionsincludingpositionorvelocitymonitoring,asdigitalpotentiometerencoderinputs,orasmasterencodersformaster/slaveandgearingapplications.ThefollowingtableliststheresourceIDsforencoders:
ResourceName ResourceIDEncoderControl 0x20(32)Encoder1 0x21(33)Encoder2 0x22(34)Encoder3 0x23(35)Encoder4 0x24(36)Encoder5 0x25(37)Encoder6 0x26(38)Encoder7 0x27(39)Encoder8 0x28(40)Encoder9 0x29(41)Encoder10 0x2A(42)Encoder11 0x2B(43)Encoder12 0x2C(44)Encoder13 0x2D(45)Encoder14 0x2E(46)Encoder15 0x2F(47)
VIsthatcanoperateonmultipleencoderssimultaneously(forexample,ReadHigh-SpeedCaptureStatus)cantaketheencodercontrol(0x20)astheirresourceparameter.
Allencodersfeaturehigh-speedcaptureinputsandbreakpointoutputs.ThesefeaturesareimplementedintheencoderprocessorFPGAandarefullyfunctionalwhenanencoderisusedasanindependentresourceorasfeedbackforanaxis.
UsingEncodersNineThroughFifteen
Completethefollowingstepstouseencodersninethroughfifteen:
1. OpenthedesiredVIinLabVIEW.2. Viewtheblockdiagram.3. Right-clicktheappropriateterminalandselectCreate»Constant.4. Clickthedrop-downarrowontheconstantandselectOther.5. Typetheselectedencodernumber(indecimal)forencodersninethrough
fifteen.
ADCChannelsYoucanuseADCchannelsasanalogfeedbackforaxesorasgeneral-purposeanaloginputstomeasuresensorsorpotentiometers.
AllADCchannelsaremultiplexedandautomaticallyscannedtokeeptheconvertedADCregistervaluescurrent.ThefollowingtableliststheresourceIDsforADCs:
ResourceName ResourceIDADC1 0x51(81)ADC2 0x52(82)ADC3 0x53(83)ADC4 0x54(84)ADC5 0x55(85)ADC6 0x56(86)ADC7 0x57(87)ADC8 0x58(88)ADC9 0x59(89)ADC10 0x5A(90)ADC11 0x5B(91)ADC12 0x5C(92)ADC13 0x5D(93)ADC14 0x5E(94)ADC15 0x5F(95)
ADCchannelsdonottypicallyprovidethesameleveloffeedbackperformanceasencoders,buthavetheadvantageofprovidingabsoluteratherthanincrementalfeedback.
On7340/7330controllers,ADCs5through8arehard-wiredtospecificsources,andcannotbeusedasgeneral-purposeresourcesorasfeedbackdevices.RefertotheReadADCsVIformoreinformation.
UsingADCsNineThroughFifteen
CompletethefollowingstepstouseADCsninethroughfifteen:
1. OpenthedesiredVIinLabVIEW.2. Viewtheblockdiagram.3. Right-clicktheappropriateterminalandselectCreate»Constant.4. Clickthedrop-downarrowontheconstantandselectOther.5. TypetheselectedADCnumber(indecimal)forADCsninethroughfifteen.
DACOutputsDACresourcesaretypicallymappedtoservoaxesandgeneratetheanalogcontroloutputsfromthePIDloops.DACresourcesthatarenotusedbyaxesareavailablefornon-axisspecificapplications.YoucandirectlycontrolanunmappedDACasageneral-purposeanalogoutput.
TheDACoutputsoffer16-bitresolutionandtheindustry-standard±10Vrange.RefertothespecificationsofthemotioncontrollerdocumentationforcompleteDACoutputspecifications.ThefollowingtableliststheresourceIDsforDACs:
ResourceName ResourceIDDAC1 0x31(49)DAC2 0x32(50)DAC3 0x33(51)DAC4 0x34(52)DAC5 0x35(53)DAC6 0x36(54)DAC7 0x37(55)DAC8 0x38(56)DAC9 0x39(57)DAC10 0x3A(58)DAC11 0x3B(59)DAC12 0x3C(60)DAC13 0x3D(61)DAC14 0x3E(62)DAC15 0x3F(63)
UsingDACsNineThroughFifteen
CompletethefollowingstepstouseDACsninethroughfifteen:
1. OpenthedesiredVIinLabVIEW.2. Viewtheblockdiagram.3. Right-clicktheappropriateterminalandselectCreate»Constant.4. Clickthedrop-downarrowontheconstantandselectOther.5. TypetheselectedDACnumber(indecimal)forDACsninethroughfifteen.
StepperOutputsStepperoutputresourcesgeneratethesteppulsesrequiredforstepperaxiscontrol.TheyoperateliketheDACoutputinaservoaxis.
NI-Motionsupportsthetwoindustry-standardstepperoutputconfigurations:StepandDirection,orCW/CCWpulses.RefertoConfigureStepperOutputformoreinformationabouttheseoutputconfigurations.ThefollowingtableliststheresourceIDsforstepperoutputs:
ResourceName ResourceIDStepperOutput1 0x41(65)StepperOutput2 0x42(66)StepperOutput3 0x43(67)StepperOutput4 0x44(68)StepperOutput5 0x45(69)StepperOutput6 0x46(70)StepperOutput7 0x47(71)StepperOutput8 0x48(72)StepperOutput9 0x49(73)StepperOutput10 0x4A(74)StepperOutput11 0x4B(75)StepperOutput12 0x4C(76)StepperOutput13 0x4D(77)StepperOutput14 0x4E(78)StepperOutput15 0x4F(79)
UsingStepperOutputsNineThroughFifteen
Completethefollowingstepstousestepperoutputsninethroughfifteen:
1. OpenthedesiredVIinLabVIEW.2. Viewtheblockdiagram.3. Right-clicktheappropriateterminalandselectCreate»Constant.4. Clickthedrop-downarrowontheconstantandselectOther.5. Typetheselectedstepperoutputnumber(indecimal)forstepperoutputs
ninethroughfifteen.
General-PurposeI/OPortsYoucanusethegeneral-purposeI/Oportstructureforprogrammablelogiccontroller(PLC)functionsorforsimplepointI/O.RefertoAnalog&DigitalI/OVIsforinformationabouthowtoconfigurethedirectionandpolarityoftheI/Oportsandbits,setandresetindividualbits,andreadthelogicalportstatus.
TheseI/Oportsarealsohardwareresources,butbecausetheyarenevermappedtoaxes,theyarenotconsideredmotionresources.Referto73xxControllerGeneral-PurposeI/OPortIDsandNISoftMotionControllerGeneral-PurposeI/OPortIDsforI/Oportresourcenumbers.
Notes
1. TheRTSIportisnotsupportedbytheNISoftMotionController.2. TheresourceIDfortheRTSIportis0x09(9).
UsingUnlistedGeneral-PurposeI/OPorts
Completethefollowingstepstouseunlistedgeneral-purposeI/Oports:
1. OpenthedesiredVIinLabVIEW.2. Viewtheblockdiagram.3. Right-clicktheappropriateterminalandselectCreate»Constant.4. Clickthedrop-downarrowontheconstantandselectOther.5. Typetheselectedportnumber,indecimal.
AvailableI/OResources
ThefollowingtableliststheI/Oresourcesbycontrollertype.
Device DigitalI/OLinesNI7330 four8-bitports,RTSII/OportNI7340 four8-bitports,RTSII/OportNI7350 eight8-bitports,RTSII/Oport
NIPCI-7390 four2-bitinputports,four2-bitoutputports,RTSII/Oport
NISoftMotionControllerforXenus(CopleyControlsCANopendrive)
sevendigitalinputlines,threedigitaloutputlinesperaxis
NISoftMotionControllerforAccelnet(CopleyControlsCANopendrive)
sevendigitalinputlines,twodigitalinputlinesperaxis
73xxControllerGeneral-PurposeI/OPortIDs7330,7340,and7350ControllerI/OPortResourceIDs
ThefollowingtableliststheresourceIDsforI/Oportson7330,7340,and7350controllers.
NoteTheI/OlinedirectionisuserconfigurableusingtheSetI/OPortDirectionVI,sothesecontrollersdonothaveseparateportIDsforinputandoutputports.
ResourceName ResourceIDI/OPort1 0x01(1)I/OPort2 0x02(2)I/OPort3 0x03(3)I/OPort4 0x04(4)I/OPort5 0x05(5)I/OPort6 0x06(6)I/OPort7 0x07(7)I/OPort8 0x08(8)RTSIPort 0x09(9)
PCI-7390ControllerI/OPortResourceIDs
ThefollowingtableliststheresourceIDsforI/OportsonthePCI-7390controller.
DigitalInputPortsResourceName ResourceIDInputPort1 0x01(1)InputPort2 0x02(2)InputPort3 0x03(3)InputPort4 0x04(4)
DigitalOutputPortsResourceName ResourceIDOutputPort1 0x81(129)OutputPort2 0x82(130)OutputPort3 0x83(131)OutputPort4 0x84(132)
NISoftMotionControllerGeneral-PurposeI/OPortIDsThefollowingtableliststheresourceIDsforI/OportsontheNISoftMotionController:
DigitalInputPortsResourceName ResourceIDInputPort1 0x01(1)InputPort2 0x02(2)InputPort3 0x03(3)InputPort4 0x04(4)InputPort5 0x05(5)InputPort6 0x06(6)InputPort7 0x07(7)InputPort8 0x08(8)InputPort9 0x09(9)InputPort10 0x0A(10)InputPort11 0x0B(11)InputPort12 0x0C(12)InputPort13 0x0D(13)InputPort14 0x0E(14)InputPort15 0x0F(15)
DigitalOutputPortsResourceName ResourceIDOutputPort1 0x81(129)OutputPort2 0x82(130)OutputPort3 0x83(131)OutputPort4 0x84(132)OutputPort5 0x85(133)OutputPort6 0x86(134)OutputPort7 0x87(135)OutputPort8 0x88(136)OutputPort9 0x89(137)OutputPort10 0x8A(138)OutputPort11 0x8B(139)OutputPort12 0x8C(140)OutputPort13 0x8D(141)OutputPort14 0x8E(142)OutputPort15 0x8F(143)
TrajectoryParametersAlltrajectoryparametersforservoandclosed-loopstepperaxesareexpressedintermsofquadratureencodercounts.Parametersforopen-loopstepperaxesareexpressedinsteps.Forservoaxes,theencoderresolutionincountsperrevolutiondeterminestheultimatepositionalresolutionoftheaxis.
Forstepperaxes,thenumberofstepsperrevolutiondependsuponthetypeofstepperdriverandmotorbeingused.Forexample,asteppermotorwith1.8°/step(200steps/revolution)usedinconjunctionwitha10xmicrostepdriverwouldhaveaneffectiveresolutionof2,000stepsperrevolution.Resolutiononclosed-loopstepperaxesislimitedtothestepsperrevolutionorencodercountsperrevolution,whicheveriscoarser.
TherearetwootherfactorsthataffectthewaytrajectoryparametersareloadedtotheNImotioncontrollerversushowtheyareusedbythetrajectorygenerators:floating-pointversusfixed-pointparameterrepresentation,andtimebase.
Youcanloadsometrajectoryparametersaseitherfloating-pointorfixed-pointvalues.TheinternalrepresentationontheNImotioncontrollerisalwaysfixed-point,however.Thisfactisimportantwhenworkingwithonboardvariables,input,andreturnvectors.Italsohasasmalleffectonparameterrangeandresolution,asshownintheexampleintheVelocityinRPMtopic.
Thesecondfactoristhetimebase.Velocityandaccelerationvaluesareloadedincounts/s,RPM,RPS/sec,steps/s,andsoon—allfunctionsofsecondsorminutes.ButthetrajectorygeneratorsupdatetargetpositionattheTrajectoryUpdateRate,whichisprogrammablewiththeEnableAxesVI.Thismeansthattherangefortheseparametersdependsontheupdaterateselected,asshownintheexampleintheVelocityinRPMtopic.
RPMvaluesstoredinonboardvariablesareindouble-precisionIEEEformat(f64).RefertoOnboardVariablesandInputandReturnVectors,forinformationaboutthenumberofvariablesrequiredtoholdanRPMvalue.
NI73xxVelocityinRPM
NI73xxVelocityinCounts/sorSteps/s
NI73xxAccelerationinCounts/s2
NI73xxAccelerationinRPS/s
NI73xxVelocityOverrideinPercent
NI73xxArcAnglesinDegrees
ValueMotiontoNI-MotionConversionToaidinconvertingaValueMotionapplicationtoNI-Motion,thefollowingtablelistseachVIintheValueMotionAPIandgivesthenearestNI-MotionVI.SomeValueMotionVIsarerelatedtotwoNI-MotionVIs.Inthesecases,thefirstVIistheclosestmatchtotheValueMotionVI,butthesecondNI-MotionVI,incombinationwiththefirst,isrequiredtocompletelymimicthefunctionalityoftheoriginalValueMotionVI.
RefertotheindividualVIsinboththeValueMotionandNI-MotionVIonlinehelpfordetailedinformationaboutthefunctionalandsyntacticdifferences.
ValueMotionVIName NI-MotionEquivalent
AcquireSamples AcquireTrajectoryDataClearReturnDataBuffer FlushReturnDataBufferCommunicate ReadReturnDataBufferConfigureMasterSlave ConfigureGearMaster
EnableGearingEnable4ALimitSwitchInputs EnableLimits
EnableHomeInputsEnableBreakpoint EnableBreakpointOutput
ConfigureBreakpointEnableTriggerInputs WaitonConditionFindHome FindReferenceHomeFindIndex FindReferenceIndexGetBoardType GetMotionBoardInformationGetMotionBoardInfo GetMotionBoardInformationInitializeController InitializeControllerKillAll StopMotionKillMotion StopMotionLoadAcceleration LoadAcceleration/DecelerationLoadAccelerationFactor NotsupportedLoadBreakpoint LoadBreakpointPositionLoadBreakpointRepeatPeriod LoadBreakpointModulusLoadDerivativeGain LoadSinglePIDParameter
VIExecutionTimesForselectedVIexecutiontimes,selectyourcontrollerfromthefollowinglist:
NI7330NI7334NI7340NI7342NI7344NI7350NI7390
CommunicationbetweentheHostComputerandtheNIMotionControllerThehostcomputercommunicateswiththeNImotioncontrollerthroughanumberofI/OportaddressesontheISAorPCIbus.
Atthecontroller'sbaseaddressistheprimarybidirectionaldatatransferport.ThisportsupportsFIFOdatapassinginbothsendandreadbackdirections.TheNImotioncontrollerhasbothacommandbufferforincomingcommandsandaReturnDataBuffer(RDB)forreturndata.
Atoffsetsfromthecontroller'sbaseaddressaretworead-onlystatusregisters.TheflowofcommunicationsbetweenthehostandtheNImotioncontrolleriscontrolledbyhandshakingbitsintheCommunicationsStatusRegister(CSR).TheMCSregisterprovidesinstantaneousmotionstatusofallaxes.
BoardIdentificationParameter
Packets,Handshaking,andFIFOBuffers
ReturnDataBuffer
BoardIdentificationParameterAllVIsinNI-MotionhaveBoardIDasthefirstparameter.BoardIDisdefinedasboardID(u8)—theboardidentificationnumberassignedbyMeasurement&AutomationExplorer.
BoardIDisauniquenumberassignedtoeachmotioncontrollerinthesystembyMeasurement&AutomationExplorer.Afterthisassignmentismade,allNI-MotionVIsusethisboardIDtosendandreceivecommandsanddatatoorfromaspecificNI-Motioncontroller.MostNI-MotionVIsalsohaveaBoardIDOutterminalwhichisprovidedforflowcontrol.YoucanstringtogetherNI-MotionVIsbywiringtheBoardIDOutterminalofoneVItotheBoardIDterminalofthenextVI.
Packets,Handshaking,andFIFOBuffersThistopicbrieflydescribeshowcommandsanddataarepassedbetweenthehostcomputerandtheNImotioncontroller.Thisinformationisprovidedforreferencepurposes.TheNI-Motionsoftwareprovidesdrivers,DLLs,andCfunctionlibrariesthathandlethehost-to-controllercommunicationsforyou.
DatapassedtoorfromtheNImotioncontrollerishandledinapacketformat.Apacketconsistsofapacketidentifierword,commandanddatacontent,andapacketterminatorword.Thisapproachtocommunicationsenhancestheintegrityofdatacommunications,speedstheprocessingofthetransferredcommandanddata,andorganizesoperationintopowerful,high-levelfunctions.
EachwordinapacketissentoverthebusaftercheckingtheReady-to-Receive(RTR)handshakingbitintheCSR.RefertotheReadCommunicationStatusVIforthestatusclusterandmoreinformationaboutthestatusreportedintheCSR.
Commandanddatapacketsarecheckedforpacketformaterrorsasthecontrollerreceivesthem.Ifthecontrollerdetectsapacketerror,itimmediatelyreportstheerrorbysettinganerrorbitintheCSR.Whenthepacketisreceivedwithouterror,thecommandanddataisstoredinaFIFObuffer.
ThisFIFOcanholdupto16commands.TheNI-MotionRTOSprocessescommandswhenitisnotbusywithhigherprioritytasks.IntheunlikelyeventthattheFIFOfillsupbeforeanycommandscanbeprocessed,thehostisheldoffwithaNot-Ready-to-Receivecondition.
Eachcommandisprocessedandadeterminationismadewhethertoexecutethecommandimmediately,orstoreitawayinaprogramtoexecutelater.Commandsarealsocheckedfordataandmodal(sequence)errorsatthistime.ModalerrorsareflaggedbysettingtheErrorMessagebitintheCSR.Thismodalerrorisfunctionallydifferentfromthepacketcommunicationerrorpreviouslydescribed.RefertoErrorsandErrorHandlingformoreinformation.
ReturnDataBuffer(73xxControllersOnly)DataorstatusrequestedbythehostisbufferedintheReturnDataBuffer(RDB)inFIFOmode.TheFIFOis16commandsdeep.
WhendataexistsintheRDB,theReadytoSendbitintheCommunicationStatusRegister(CSR)isset.
YoucanusetheRDBeitherasatemporarybufferthatholdsasinglereturndatapacket,orasasmallFIFObuffer.WhentherequesteddataisavailableintheRDB,useReadReturnDataBuffertoretrieveit.Youalsocanrequestmultipledataitemsandleavetheminthebufferforretrievalatalatertime.IftheRDBbecomesfullandcannotaccommodaterequestedreturndata,NI-MotiongeneratesanerrorandsetstheErrorMessagebitintheCSR.
ErrorsandErrorHandlingTominimizethepossibilityoferroneoussystemoperation,VIs,packets,anddataarecheckedforerrorsatmultiplelevelswithintheNI-MotionsoftwareandwithinthefirmwarethatresidesontheNImotioncontroller.
Inaperfectsystem,errorsshouldnotbegenerated.However,duringapplicationdevelopmentanddebugging,errorsareunfortunatelyquitecommon.NI-MotionoffersanextensiveerrorhandlingstructureandutilityVIstoallowyoutoquicklydiagnoseanyerror-generatingsituation.RefertotheError&UtilityVIsforinformationaboutspecificVIsandErrorCodesforalistingoferrorsreturnedbyNI-Motion.
ErrorCodesThefollowingtablelistsallNI–Motionerrorcodes,symbolicnames,andabriefdescriptionoftheassociatederrorconditions.
RefertotheError&UtilityVIsfordetaileddescriptionsoftheVIsforerrorhandling.RefertoErrorsandErrorHandlingformoreinformationabouterrorsanderrorhandlingtechniques.
ErrorCode SymbolicNameDescription
0 NIMC_noError Noerror.
-70001 NIMC_readyToReceiveTimeoutError
ReadytoReceiveTimeout.Thecontrollerisstillnotreadytoreceivecommandsafterthespecifiedtimeoutperiod.Thiserrormayoccurifthecontrollerisbusyprocessingpreviouscommands.Ifthiserrorpersists,evenwhenthecontrollershouldnotbebusy,contactNationalInstruments.
-70002 NIMC_currentPacketError
Eitherthisfunctionisnotsupportedbythistypeofcontroller,orthecontrollerreceivedanincompletecommandpacketandcannot
ErrorCodesThefollowingtablelistsallNI–Motionerrorcodes,symbolicnames,andabriefdescriptionoftheassociatederrorconditions.
RefertotheError&UtilityVIsfordetaileddescriptionsoftheVIsforerrorhandling.RefertoErrorsandErrorHandlingformoreinformationabouterrorsanderrorhandlingtechniques.
ErrorCode SymbolicNameDescription
0 NIMC_noError Noerror.
-70001 NIMC_readyToReceiveTimeoutError
ReadytoReceiveTimeout.Thecontrollerisstillnotreadytoreceivecommandsafterthespecifiedtimeoutperiod.Thiserrormayoccurifthecontrollerisbusyprocessingpreviouscommands.Ifthiserrorpersists,evenwhenthecontrollershouldnotbebusy,contactNationalInstruments.
-70002 NIMC_currentPacketError
Eitherthisfunctionisnotsupportedbythistypeofcontroller,orthecontrollerreceivedanincompletecommandpacketandcannot
ErrorHandlingTechniquesInadditiontousingtheerrorinanderroroutterminalsoneachmotionVI,checkformodalerrorsbycallingtheMotionErrorHandlerVIintheapplication.TheMotionErrorHandlerVIchecksthecontrollerforerrorsandreadanddisplayerrorsfromtheErrorStackiftheyexist.RefertotheexampleVIsintheLabVIEW\Examples\Motion\NI-MotiondirectorytoseehowthisVIisused.
Howoftentocheckformodalerrorsdependsupontheapplication,butyoucanusethefollowinglistasaguideline:
1. Checkforerrorsattheendofeachmajorsubroutineorfunctionalblock.2. Checkforerrorsattheendofaninitializationprocedure.Evenbetteristo
alsocheckaftereachaxisinitialization.AfterexecutingaFindReferenceVI,checktomakesurethesequencecompletedsuccessfully.
3. Includeanerrorcheckineverystatuspollingloop.Mostapplicationsincludeapollinglooptodisplaymotionstatus,position,velocity,andsoon.Thiswayyouareassuredofnevermissinganerror.
4. Duringdebugging,youcanrunanindependentVItocheckforerrors.TheErrorMonitorVIintheError&Utilitypaletteisprovidedforthispurpose.YoucanrunthisVIwhileanotherVIisexecutingmotionVIs,andtheErrorMonitordisplaysmodalerrors.
Foradditionalinformationabouterrors,refertothefollowingtopics:
OnboardVariables
FatalHardwareandCommunicationsErrors
ErrorMessageStackModalerrorsgenerateanerrormessagecontainingthecommandID,resourceID,anderrorcodethatispushedontheErrorMessageStackontheNImotioncontrollerandflaggedintheErrorMessage(ErrMsg)bitoftheCommunicationsStatusRegister(CSR).YoucanreturnamodalerrormessagetothehostbyexecutingtheReadErrorMessageVI.
Foryourconvenience,theMotionErrorHandlerVIcheckstheCSRforerrors,andifanerrorispresentonthestack,readstheerrormessagefromthecontroller.
TheErrorMessageStackisorganizedasalast-in-first-out(LIFO)buffersothatthemostrecenterrorisavailableimmediately.OldererrorscanbereadwithadditionalcallstotheMotionErrorHandlerVIandarereturnedintheinverseordertowhichtheyweregenerated.Whenthestackisempty,theErrorMessage(ErrMsg)bitintheCSRisreset.
TheErrorStackcanholdupto10errors.Whenthestackisfull,whichisanunlikelyevent,additionalerrormessagesarethrownaway.
FatalHardwareandCommunicationsErrorsThereareafewerrorsthat,ifdetected,indicateasevereorfatalerrorcondition.TheseincludebutarenotlimitedtoBoardFailureError,WatchdogTimeoutError,FPGAProgramError,DSPInitializationError,I/OInitializationError,andReadytoReceiveTimeoutError.
RefertoErrorCodes,foracompletelistoferrorcodesandpossiblecauses.
Fatalerrorsareunlikely,butiftheyoccur,trytoclearthembyresettingorpowercycling.Ifthisproceduredoesnotcleartheproblem,refertoTechnicalSupportandProfessionalServices.
ModalandNon-ModalErrorsNI-Motioncandetecttwotypesoferrors—modalandnon-modal.Non-modalerrorsareerrorsdetectedatthetimeofVIexecution.Thisincludescommunicationsfailures,parametervalueerrors,andbadBoardIDerror.
IfaNI-MotionVIencountersanon-modalerror,suchasthoselistedabove,communicationwiththecontrollerisimpossible,andthecommandisneversenttooracceptedbythecontroller.TheVIreportsthiserrorintheerroroutcluster.WhenVIsarewiredtogetherthroughtheErrorInandErrorOutterminals,allVIsdownstreamofaVIcausinganon-modalerrordonotexecute.However,theStopMotionVIalwaysexecutes,evenifanotherVIencounteredanerrorearlier.
Modalerrors,ontheotherhand,areerrorsthatarenotdetectedatthetimeofVIexecution,becauseVIscanbebufferedintheonboardFIFO.Furthermore,someVIscanbelegalatonetimeandillegalatanother,dependingonthestateormodeoftheNImotioncontroller.ThismodalerrorstructurealsocorrectlydetectserrorsgeneratedbyincorrectlysequencedVIsinonboardprograms.Modalerrorsareplacedintheonboarderrorstack,andyouhavetoexplicitlyquerythecontrollertocheckforerrors.TheMotionErrorHandlerVIcheckstheonboarderrorstackeverytimeyoucallit.
VITypesandParametersInadditiontotheAPIfunctionalorganization,NI-MotionVIscanbecategorizedbycommonformat,execution,andparametercharacteristics.
BitmappedversusPer-ResourceVIs
SingleandDouble-BufferedParameters
InputandReturnVectors
OnboardVariables
BitmappedversusPer-ResourceVIsTherearetwobasictypesofNI-MotionVIs—thosethatoperateononeresourceatatime,andthosethatoperateonmultipleaxes,vectorspaces,I/Obits,andsoonsimultaneously.
Per-resourceVIstypicallysendnumericvaluesto,orreadnumericvaluesfrom,theselectedaxisorresource.Theyoperateidenticallyoneachaxisormemberintheresourcefamily.
Incontrast,VIsthatoperateonmultiplebitssendandreturnbitmaps,whereeachbit(axis,vectorspace,I/Obit,andsoon)isrepresentedbyonebitinthebitmap.
SomeVIssetandresetbitsinthebitmapusingtheMustOn/MustOff(MOMO)protocol.Thistri-stateprotocolallowsyoutoset/resetoneormorebitswithoutaffectingtheotherbitsinthebitmap.RefertoanyoftheMOMOVIdescriptionsforcompleteinformationaboutthisprotocol.
BitmappedVIsactonallbitssimultaneously.Becauseeachexecutionreconfiguresallbitsinthebitmap,donotusetheseVIsincrementally.
InputandReturnVectorsManyVIsthatloadvaluesandvirtuallyallreadbackVIssupportvectoring.LoadVIs,forexampleLoadTargetPosition,takeaninputvectorthatspecifiesthesourceofthedata,eitherimmediate(usingtheVIinputparameters),fromageneral-purposeonboardvariable,orfromanindirectvariable.ReadVIs,forexampleReadPosition,takeareturnvectorthatspecifiesthedestinationforthereturneddata,eitherthehostcomputer,anonboardvariable,oranindirectvariable.
TheabilitytousevariablesinmotioncontrolVIsisoneofthepowerfulfeaturesoftheNI-Motiononboardprogrammingenvironment.Youcanreaddatafromaresourceintoavariable,scaleorperformsomeothercalculationonthevalue,andthenloadthenewvalueasatrajectoryorothermotionparameter.AllDataOperationsVIstakedatafromvariablesandreturntheresultthroughareturnvector,typicallytoanothervariable.
NoteDatareturnedtothehostbyareturnvectorof0xFFisactuallyleftintheReturnDataBuffer(RDB).ReaddatafromtheRDBusingReadReturnDataBuffer.
Inadditiontospecifyingavariabledirectly,youcanuseindirectvariablestoreferenceavariableindirectly,muchlikeapointerinC.RefertoOnboardVariablesformoreinformation.
Inputandreturnvectorsareveryusefulwhenwritingonboardprogramsbuthavelittleornouseinprogramsrunningonthehostcomputer.Forthisreason,thedefaultvalueforinputvectorisimmediate(0xFF).
NoteThereturnvectormustbe0xFFonthe7330and7390,becausethey
donotsupportonboardprogramming.
RefertoCommunicationbetweentheHostComputerandtheNI-MotionControllerforinformationabouttheRDB.
OnboardVariablesNI-Motionsupports120general-purposevariables(0x01through0x78)foruseinonboardprograms.Variablesare32bitswideandcanholdeithersigned(i32)orunsigned(u32)values.Variablescanbereferencedininputandreturnvectorparameters.DataOperationsVIsusevariablesexclusivelyforinputoperandsandtheoutputresult.
Ingeneral,mostVIshaveasingledataparameterthatfitsintoasingle32-bitvariable.IftheVIusesonlya16-bitdatavalue,itisintheleastsignificantportion(right-most)ofthe32-bitvariable.However,someVIswithinputorreturnvectorshavemorethanonedataparameter.Asageneralrule,eachparameter,regardlessofsize,requiresitownvariable.FortheseVIs,thevectorpointstothefirstvariableinasequentialgroupofvariables.Parametersarethenassociatedwithvariablesinsequentialorder.
AfewadvancedVIshandlevariablesdifferentlyfromthepreviousdescription.RefertoUsingInputsandReturnVectorswithOnboardVariablesformoreinformationaboutvariablesandvectors.
IndirectVariables
IndirectvariablesprovidefunctionalitysimilartopointersinaprogramminglanguagesuchasC.Whenyouuseanindirectvariable(0x81through0xF8)asaninputvectororreturnvector,theNI-Motionsoftwarelooksatthecontentsoftheindirectvariableandusesthatvalueastheinputorreturnvector.Indirectvariables0x81through0xF8correspondtovariables0x01through0x78.Sowhenyouspecifyaninputvectorof0x81,theNImotioncontrollerusesthecontentsofvariable0x01astheinputvector.Thiscanbeveryusefulinloopingstructuresinonboardprograms,aswellaschangingtheinputvaluestoVIsdynamically.
Example
Supposethevaluesofonboardvariables1to10areasfollows:
0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0A
0 7 0 0 0 0 1000 0 0 0
Inthisexample,readingtheindirectvariable0x82returnsthevalue1000.
NoteYoucansavetheentiresetofonboardgeneral-purposevariablestoFlashROMwiththeSaveDefaultParametersVI.
VariableArray
VariablearraysareusedwhenreadingorwritingabufferofdatatoorfromonboardmemoryusingtheReadBufferorWriteBufferVIs.
Inmemory,thebufferoccupiesn+2variables,wherenisthenumberofbufferelementsread.Thefirstvariablecontainsthenumberofvaluesreadfromthebuffer.Thesecondvariablecontainstheerrorcodeofthereadoperation.Ifthisvalueiszero,thennoerroroccurred.Thenextnelementsarethevaluesreadfromthearray.Thereadbufferaccountsforthetwoadditionalvalue.However,whenyouarewritingabufferusingavariablearray,thesecondparameteristheregenerationmode,notanerrorcode.
Example
Supposetheonboardvariablelookslikethefollowing:
0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 ...5 0 0 0 0 0 0 0 ...
Further,supposethatthereisabuffercontainingthefollowingelements:
1 2 3 4 5
Ifyouweretoreadthefirstfiveelementsofthebuffertoonboardmemorylocation0x81,theonboardmemorywouldlooklikethefollowing:
0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xA 0xB 0xC ...5 0 0 0 5 0 1 2 3 4 5 0 ...
0x5containsthenumberofelementstoread.0x6displaystheerrorsthatoccurred.Inthiscase,thelocationcontainsa0,meaningnoerrorsoccurred.
0x7–0xBarethefiveelementsthatwereread.
ReflectiveMemoryVIsSomeoftheAdvancedReadVIsusereflectivememorytoreturnstatusanddatainformationtothecontroller.UnlikethetrajectorycontrolVIsthatalsoreturnthisinformation,thesespecializedVIsreadstatusanddatainformationfromtheregisterandsenditbackinamuchhigherresponsetime.
TheseVIsshouldnotbeusedforeventchecking.OnlyusetheinformationreturnedbytheseVIsfordisplaypurposes.ThisisbecausethetradeoffforsignificantlyfasterresponsetimeisthattheseVIsarenotserializedwithotheroperations.VIsthatreturndatainformationarereadfromaregisteronthecontrollerandrefreshedevery5ms.VIsthatreturnstatusinformationarerefreshedassoonaspossible.Thisconfigurationmakesthedataandstatusinformationquicklyaccessible—inabout40µsasopposedto>2mswiththetrajectorycontrolVIs.However,thisalsomeansthatyoucanreadstatusinformationsoonerthantheVIhastimetoexecute.Forexample,acalltoStartMotionfollowedimmediatelybyacalltothemovecompleteattributeoftheReadExecutionStatusVImayreturnaTruevaluebecausetheStartMotionVImaynothavestartedbeforethemovecompletestatusinformationisreturned.
NoteVIsusingreflectivememoryarenotsupportedbytheNISoftMotionController.
ThefollowingtableliststheVIsusingreflectivememory,whichcontrollerhasreflectivememorysupport,andwhichattributesusereflectivememory,ifapplicable:
Function 7330 7340 7350 7390ReadAllAxisData — — Y YReadAllAxisStatus — — Y YReadAxisData(allattributes) — — Y YReadAxisStatus(allattributes) — — Y YReadCaptureCompareData
CapturedPosition — — N N
PositionCaptureOccurred
PositionCompareOccurred
—
—
—
—
Y
Y
Y
Y
ReadCoordinateData(allattributes) — — Y YReadCoordinateStatus(allattributes) — — Y YReadCoordinatePosition(allattributes) — — Y YReadDigitalI/OData
OutputActiveState
InputActiveState
OutputActive
InputActive
ConfigureAsInput
N
N
N
N
N
N
N
N
N
N
N
N
Y
Y
N
N
N
Y
Y
—
ReadEncoderData(allattributes) — — Y Y
ReadMotionI/OData
ForwardLimitActive
ReverseLimitActive
ForwardSoftwareLimitActive
ReverseSoftwareLimitActive
HomeInputActive
Inhibit-InActive
In-PositionActive
N
N
N
N
N
N
N
N
N
N
N
N
N
N
Y
Y
Y
Y
Y
N
N
Y
Y
Y
Y
Y
N
N
DriveReadyActive
Inhibit-OutActive
N
N
N
N
N
N
N
N
SingleandDouble-BufferedParametersAlmostallNI-Motionparametersareeithersingle-bufferedordouble-bufferedonthecontroller.Single-bufferedparameterstakeeffectimmediatelyuponVIexecutionandremainineffectuntiltheyareoverwrittenwithanothercalltotheVIthatloadedorsetthem.Itisnotnecessarytoconstantlyreloadsingle-bufferedparameterseachtimeyoudealwithanaxis,vectorspace,orresource.TheobviousexceptiontothisisactioncommandslikeStartMotion,StopMotion,FindReference,andsoon,whichmustbecalledeachtime.
Mosttrajectorycontrolparametersaredouble-buffered.Youcanloadtheseparametersontheflywithoutaffectingthemoveinprocess.TheydonottakeeffectuntilthenextStartorBlendMotionVIisexecuted.Likesingle-bufferedparameters,thecontrollerretainsthevaluessotheydonothavetobeloadedbeforeeachmoveunlessyouwanttochangetheirvalues.
LoadBreakpointPositionandLoadBreakpointModulusaretheonlynon-trajectoryparametersthatarealsodouble-buffered.TheyhavenoeffectuntilyouexecuteasubsequentEnableBreakpointOutputVI.
UsingInputandReturnVectorswithOnboardVariablesThistablegivesadditionalinformationabouthowtouseinputandreturnvectorsinconjunctionwithonboardvariables.ThefollowingtablelistsVIswithmorethanonedataparameterthatrequiremultiplevariableswhenusingvectors.TheMaximumVariableNumbercolumnliststhehighestvariablenumberthatavectorcanpointtoandstillhaveroomforallthedatawithoutexceedingthetotalvariablespace.Thistablealsocontainsnotesthathighlightafewspecialcaseswherethenumberofparametersdoesnotequalthenumberofvariables.
VIName
VectorType
NumberofParameters
NumberofVariablesRequired
MaximumVariableNumber
Comments
LoadAllPIDParameters Input 8 8 0x71
LoadVelocityFilterParameter
Input 2 2 0x77
LoadVelocityinRPM Input 1 2(Note1) 0x75
NationalInstrumentsrecommendsusingLoadVelocityforonboardvariables.
LoadAccel/DecelinRPS/sec
Input 1 2(Note1) 0x75
LoadVectorSpacePosition
Input 3 3 0x76
NationalInstruments
AbouttheNI-MotionSoftwareNI-MotionsoftwareprovidesacomprehensiveAPIyouusetocontroltheNImotioncontrollers.NI-MotionsoftwarecombinedwiththeNImotioncontrollersprovidefunctionalityandpowerforintegratedmotionsystemsforuseinlaboratory,test,andproductionenvironments.
Forprogrammingease,NI-Motionsoftwareisenhancedbyatoolboxofdrivers,LabVIEWVIlibraries,andWindowsdynamiclinklibraries(DLLs)thatimplementtheentireNI-MotionAPI.
TheNI-MotionsoftwarepackageincludesMeasurement&AutomationExplorer(MAX),whichassociatesphysicalbusaddresseswithboardIDs,whichareusedinprogramstodistinguishbetweencontrollers.MAXalsoverifiesthattheNI-Motioncontrollerisinstalledcorrectlyandiscommunicatingwiththehostcomputer.
ThemotionconfigurationenvironmentunderMAXallowsyoutoconfigureinitializationsettingsthatareusedtoinitializetheNImotioncontroller.MAXalsoprovidesaneasyinteractiveenvironmentfortestingandtroubleshootingthemotionsystem.RefertotheMAXonlinehelpformoreinformation.
Forapplicationdevelopment,theNI-Motionsoftwarepackageincludesexampleprogramstohelpgetyouupandrunningquickly.
AseparateNI-MotionsoftwarepackageincludesacompletemotionClibrary,withexamples,forusewithCorC++developmentenvironments.
InitializationTheconfigurationpanelsinMeasurement&AutomationExplorer(MAX)allowyoutosetalargenumberofNImotioncontrollerattributessuchasmotortype,limitswitchpolarity,positionmode,andmaximumvelocity.Mostoftheattributesareone-timeconfigurationsettingsthatdonotchange.BysettingtheseattributesonetimeinMAX,yourprogrammingismuchsimpler,andyoucanconcentrateonthemotion-specificpartofyourapplication.
WhenyoucalltheInitializeControllerVI,alltheattributesstoredinMAXareretrievedandsenttothemotioncontroller.Afterthecontrollerisinitialized,youdonotneedtoinitializeeachtimeyouruntheapplication.NationalInstrumentsrecommendsyoucallInitializeControlleronetimeafterrestartingthecomputerorresettingthemotionhardware.Themotorsaretemporarilydisabled(killed)whilethisinitializationprocesstakesplace.
Inmostcases,youcallInitializeControllerwiththeSettingsNameterminalunwired,whichcausesthecurrentinitializationsettingsinMAXtouse.YoualsocaninitializethecontrollerwithalternateinitializationsettingsbypassinginthenameofthealternatesettingasspecifiedinMAX.
ClicktheiconsforVIdescriptions.
InitializeController
Subpalettes
Axis&ResourceConfigurationVIs AdvancedTrajectoryVIsStart&StopMotionVIs MotionI/OVIsFindReferenceVIs BreakpointVIsAnalog&DigitalI/OVIs High-SpeedCaptureVIsAdvancedVIs Error&UtilityVIsTrajectoryControlVIs AdvancedError&UtilityVIsArcVIs OnboardProgrammingVIsGearingVIs ObjectManagementVIsBufferedOperationsVIs DataOperationsVIs
InitializeControllerInitializesthespecifiedcontrolleraccordingtothesettingsasconfiguredinMeasurement&AutomationExplorer.
Details
DeviceCompatibility
SettingsNameisthenameoftheconfigurationsettings,suchasDefault7330Settings,specifiedinMeasurement&AutomationExplorer(MAX).Tousethecurrentconfigurationsettings,leaveSettingsNameunwiredorpassNULLfortheSettingsNameparameter.ThecurrentsettingsarethesettingsthatareconfiguredinMAX.BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,
UsingThisVI
ThisVIallowsyoutoinitializethecontrollertoaknownstatebasedupontheconfigurationsettingsstoredintheMeasurement&AutomationExplorerdatabase.ThisVIpullsvaluesfromtheconfigurationdatabaseandcallsdozensofNI-MotionVIs,configuringthecontrollerforyouinonesimplestep.
IftheInitializeControllerVIreturnsanerror,youcancalltheGetLastErrorVItodeterminethespecificNI-MotionVIandresourcegeneratingtheerror.YoucanthencalltheGetErrorDescriptionVI,whichformatsastringforyouwiththeVIname,resourceID,anderrordescription.
NoteIfyouarerunningaNI-MotionstartupapplicationonETS(PharLap)systems,thefirstVIinyourapplicationmustbeeithertheClearPowerUpStatusorInitializeControllerVI.CallinganyotherVIfirstmayresultinerror–70012(NIMC_badBoardIDError)becausethedrivermaynothaveloadedbeforeaNI-MotionVIiscalled.NoteRefertoVIExecutionTimesforbenchmarktiminginformationaboutyourcontroller.
Axis&ResourceConfigurationVIsTheseVIsgiveyouaccesstosomeofthemostpowerfulfeaturesofNI-Motion.Theyallowyoutomapencoder,ADC,andDACresourcestovariousaxes,configureaxesforservoorsteppercontrol,andcombineaxesinto2Dand3Dvectorspacesforadvancedmotioncontrolapplications.
TheseaxisandresourceconfigurationVIsaretypicallyexecutedonetimeduringsysteminitialization.Youcancallmostofthematanytimetoreconfigurethemotioncontrolsystemon-the-fly.AlloftheAxis&ResourceConfigurationVIshavedefaultvaluesthatprovidegoodstartingpointsformanymotioncontrolapplications.
ClicktheiconsforVIdescriptions.
EnableAxes ConfigureMoveCompleteCriteriaConfigureAxisResources LoadVelocityFilterParameterConfigureVectorSpace LoadAllPIDParametersSetStepperLoopMode LoadSinglePIDParameterLoadCounts/StepsperRevolution LoadAdvancedControlParameterConfigureStepperOutput LoadCommutationParameter
ConfigureAxisResourcesConfiguresanaxisbydefiningitsfeedbackandoutputresources.
DetailsRemarks
DeviceCompatibility
SecondaryOutputisthenumberforanoptionalsecondaryoutputresourcebeingmappedtotheaxis.Thisisanoptionalcommandoutput.SelectNonetoconfigurenosecondaryoutputresource.SecondaryFeedbackisthenumberforanoptionalsecondaryfeedbackresourcebeingmappedtotheaxis.Ifasecondaryfeedbackresourceismapped,itisusedforvelocityfeedback(Kv).SelectNonetoconfigurenosecondaryfeedbackresource.RefertotheVelocityFeedbackGainsectionofLoadSinglePIDParameterformoreinformationaboutKv.BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.AxisistheaxisforwhichtoloadPIDparameters.Validaxisnumbersare1through15forallNImotioncontrollers.Oncontrollerswithlessthaneightaxes,configuringnon-existentaxeshasnoeffect.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassesthe
UsingThisVI
TheConfigureAxisResourcesVIdefinesthefeedbackandoutputdevicesforanaxis.Youcanconfigureuptotwofeedbackresourcesandtwooutputresourcesforeachaxis.Thisflexiblemappingofresourcestoaxesallowsforadvancedservoandstepperconfigurationssuchas:independentvelocityandpositionfeedbackdevices(dual-loopcontrol),dualDACoutputswithdifferentoffsets,andchangingfeedbackonthefly.
Thevariousfeedbackandoutputresourcesonthemotioncontrollerhavedifferentinterface,performance,andfunctionalitycharacteristics.ThisVIallowsyoutodefinetheaxisandtailoritsperformance.
Thefollowingtablelistsvalidresources:
ResourceType 7330 7340 7350 7390PrimaryFeedback Encoder/ADC Encoder/ADC Encoder/ADC EncoderSecondaryFeedback Encoder Encoder Encoder/ADC —PrimaryOutput Stepper Stepper/DAC Stepper/DAC StepperSecondaryOutput — DAC DAC —
TipRefertoMotionResourcesformoreinformationaboutresourceIDs.TipForinformationabouttheresourceIDs,refertoMotionResources.
ThisVImustbecalledforeachaxisthatisusedbyanapplicationpriortoenablingtheaxis.Thefactorydefaultmappingofresourcestoaxesisasfollows:
Axis PrimaryFeedbackSecondaryFeedback
PrimaryOutput
SecondaryOutput
1 0x21(Enc1) 0 0x31(DAC1) 02 0x22(Enc2) 0 0x32(DAC2) 03 0x23(Enc3) 0 0x33(DAC3) 04 0x24(Enc4) 0 0x34(DAC4) 05 0x25(Enc5) 0 0x35(DAC5) 0
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NI73xxControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwitha73xxmotioncontroller:
Ifyouareusinga7330,7340,or7390motioncontroller,youcannotconfigureanaxiswhenanyaxesareenabled.YoumustfirstdisableallaxesusingtheEnableAxesVI.Tochangefeedbackonthefly(NI7350controllersonly),callthisfunctionwhentheaxisisnotmoving(movecomplete).
NoteThefeedbackresourcesusedforswitchingfeedbackontheflymustmeetthefollowingconditions:
Thefeedbackdevicemustbeenabled.Thefeedbackdevicebeingswitchedtomustnotbeusedbyanotheraxis.
RefertoSwitchingFeedbackontheFlyintheNI-MotionHelpfordetailedinformationaboutconfiguringyoursystemtoswitchbetweentwofeedbackdevices.
Example1
Tochangeaxis3tousethefourthencoderchannelandthefirstDACoutput,calltheConfigureAxisResourcesVIwiththefollowingconfiguration:
Axis PrimaryFeedback
SecondaryFeedback
PrimaryOutput
SecondaryOutput
3 0x24(Enc4) 0 0x31(DAC1) 0
ConfigureMoveCompleteCriteriaConfiguresthecriteriafortheMoveCompletestatustobeTrue.
Details
DeviceCompatibility
MoveCompleteMinimumPulse(0)istheminimumtimeinmsthatthemovecompletestatusmuststaytrue.Thisparameterallowsyoutoenforceaminimumpulsewidthonthemovecompletestatuseveniftheaxisisstartedagain.Thisistheamountoftimeyouhavetoreadthemovecompletestatusbeforeitisreset.Therangeis0(default)to255ms.MoveCompleteDelay(0)isaprogrammablesettlingtimedelayinms.Youcanprogramitfrom0(default)to255ms.BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.AxisistheaxisforwhichtoloadPIDparameters.Validaxisnumbersare1through15forallNImotioncontrollers.Oncontrollerswithlessthaneightaxes,configuringnon-existentaxeshasnoeffect.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowing
UsingThisVI
TheConfigureMoveCompleteCriteriaVIdefinestheconditionsforreportingamovecomplete.Whenamoveiscompleteonanaxis,thecorrespondingbitintheMCSregisterisset.RefertotheReadMoveCompleteStatusVIforinformationaboutreadingtheMCSregister.Also,theReadperAxisStatusVIcanprovideyouwithmovecompletestatusonaspecifiedaxis.
ThisVIallowsagreatdealofcontroloverwhenandhowamoveisconsideredcomplete.TheCriteriabitmapcontainsfivebitstosettheconditionsusedtodeterminetheMoveCompletestatus.Thefirsttwo,ProfileCompleteandMotorOff,arelogicallyOR'dtoprovidethebasisforMoveComplete.TheProfileCompletebitisalwayssetandcannotbedisabled.Whentheaxistrajectorygeneratorcompletesitsprofile,thisconditionissatisfied.IftheMotorOffbitisset,anyconditionthatcausestheaxistoturnitsmotoroff(akillorfollowingerrortrip)satisfiesthisbasicrequirementforMoveComplete.Inotherwords,eitherProfileCompleteORMotorOffmustbeTrueforMoveCompletetobeTrue.
Thenextthreecriteria,Run/Stop,Delay,andIn-Position,areoptionalconditionsthatarelogicallyANDedtofurtherqualifytheMoveCompletestatus.IftheRun/Stopbitisset,theaxismustalsobelogicallystoppedforthemovetobeconsideredcomplete.RefertotheLoadRun/StopThresholdVIforinformationabouttheRun/Stopstatus.
IftheDelaybitisset,theaxismustwaitauser-defineddelayaftertheothercriteriaaremetbeforethemoveisconsideredcomplete.Theuser-definedMoveCompleteDelayparameteristypicallyusedtowaitthemechanicalsettlingtimesothatamoveisnotconsideredcompleteuntilvibrationsinthemechanicalsystemhavedampedout.ItalsocanbeusedtocompensateforPIDpull-intimeduetotheintegralterm.Thispull-inistypicallyatvelocitiesbelowtheRun/Stopthreshold.
Finally,iftheIn-Positionbitisset,theaxischecksitsfinalstoppingpositionversusitstargetpositionandonlysetstheMoveCompletestatusiftheabsolutevalueofthedifferenceislessthanthein-positiondeadband.
ConfigureStepperOutputConfiguresthedrivemode,outputmode,andpolarityofastepperoutput.
DeviceCompatibility
Details
Polaritysetsthepolarityforthestepperoutput.SelectTRUE(default)foractivelow.SelectFALSEforactivehigh.
Whenconfiguredasactivelow,theoutputisactivewhenthereisalowsignalontheoutputpin.Conversely,activehighmeansthattheoutputisactivewhenthereisahighsignalontheoutputpin.OutputModespecifiesthemodeasStepandDirectionorClockwise/Counterclockwise.BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.AxisorStepperOutputistheaxisorstepperoutputtoconfigure.Whensenttoastepperaxis,thisVIconfiguresthemappedstepperoutput.Alternatively,youcanexecutethisVIdirectlyonthestepperoutputresource.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralready
UsingThisVI
UsethisVItoconfigureastepperoutputtocorrectlyinterfacewithastepperdriver.NI-Motionsupportsthetwoindustrystandardsforsteppercontroloutputs.ThemostpopularmodeisStepandDirection,whereoneoutputproducesthesteppulsesandtheotheroutputproducesadirectionsignal.
InClockwiseandCounterclockwise(CW/CCW)mode,thefirstoutputproducespulseswhenmovingforward,orCW,whilethesecondoutputproducespulseswhenmovingreverse,orCCW.
Ineithermode,youcansettheactivepolaritywiththepolaritybitasactiveloworactivehigh.Forexample,inStepandDirectionmode,thepolaritybitsdeterminewhetherahighdirectionoutputisforwardorreverse.Italsodeterminestherestingstatesofoutputswhentheyarenotpulsing.
TheConfigureStepperOutputVIistypicallycalledforeachstepperaxispriortousingtheaxis.Afterthemodesandpolarityareset,theyremainineffectuntilchanged.YoucanexecutethisVIatanytime.
Forthe7350controller,youcansetthestepperoutputDriveModetoOpenCollectororTotemPole.Onthe7330/40,stepperoutputisOpenCollectorandcannotbechanged.Onthe7390,stepperoutputisisolatedsoDriveModedoesnotapplyandcannotbechanged.FormoreinformationaboutOpenCollectorandTotemPoledrivemodes,refertothedocumentationforyour7350device.
ConfigureVectorSpaceDefinestheaxesthatareassociatedwithavectorspace.
Details
DeviceCompatibility
ZAxis(3)isthephysicalaxis(1through15)toactasthelogicalzaxis.Thedefaultis3.BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.VectorSpaceisthevectorspacetoconfigure.
NoteForNI7330/40/90motioncontrollers,validvectorspacenumbersare0x11(default),0x12,and0x13.NoteFortheNI7350motioncontrollers,validvectorspacenumbersare0x11(default),0x12,0x13,and0x14.
errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.If
UsingThisVI
UsetheConfigureVectorSpaceVItogroupaxesintoavectorspace.Avectorspacedefinesanxandy(2D)orx,y,andz(3D)coordinatespace.Youcanmapanyphysicalaxistothelogicalx,y,andzaxestocoordinatethemotionofmultipleaxes.ThetotalnumberofvectorspacesNI-Motionsupportsinyourmotioncontrolsystemcanbecalculatedusingthefollowingformula:
totalvectorspaces= .
TipTounconfigureavectorspace,setallaxestoNone.
Afteritisconfigured,youcanusetheVectorSpacenumberinallVIsthatsupportvectorspaces.Vectorspacesareusedin2Dand3Dlinearinterpolationwithvectorposition,vectorvelocity,vectoraccelerationanddeceleration,andvectoroperationmode.Theyarealsousedincircular,helicalandsphericalarcmoves.Youcanstart,blend,andstopvectorspacesjustlikeaxes.Youcanevensynchronouslystartmultiplevectorspacesformulti-vectorspacecoordination.
ManystatusanddatareadbackVIsalsooperateonvectorspaces.Youcanreadvectorposition,vectorvelocity,vectorblendstatus,andsoon,oryoucanreadper-axisvaluesandstatusfortheaxeswithinthevectorspace.
Whilevectorspacescanbecomprisedofthreeaxes,itispossibletodefinetwo-axisorevenone-axisvectorspaces.ThesevectorspacesfunctionproperlyforallVIsthatdonotrequireagreateraxiscount.
YoucanuseothercomplexmotioncontrolVIswithvectorspaces,includingelectronicallygearinganindependentaxistoamasteraxiscontainedwithinavectorspacedefinition.
NoteRefertoVIExecutionTimesforbenchmarktiminginformationaboutyourcontroller.
Example
EnableAxesEnablestheoperatingaxesanddefinesthePIDandtrajectoryupdaterate.
DetailsRemarks
DeviceCompatibility
AxisBitmapisthebitmapofenabledaxes.Axis1—Iftrue,axisisenabled.Iffalse,axisisdisabled(default).Axis2—Iftrue,axisisenabled.Iffalse,axisisdisabled(default).Axis3—Iftrue,axisisenabled.Iffalse,axisisdisabled(default).Axis4—Iftrue,axisisenabled.Iffalse,axisisdisabled(default).Axis5—Iftrue,axisisenabled.Iffalse,axisisdisabled(default).Axis6—Iftrue,axisisenabled.Iffalse,axisisdisabled(default).Axis7—Iftrue,axisisenabled.Iffalse,axisisdisabled(default).Axis8—Iftrue,axisisenabled.Iffalse,axisisdisabled(default).
SamplePIDRateisthePIDcontrolloopandtrajectorygeneratorupdaterate,forNI73xxmotioncontrollers.Forstepperaxes,thisparameteralsodetermineshowoftenthestepgeneratorisupdated.Therangeforthisparameteris0to7,withadefaultof3(250µs).
UpdateRate=(SamplePIDRate+1)x62.5µs
SamplePIDRate UpdateRate0 62.5µs1 125µs
UsingThisVI
TheEnableAxesVIisusedtoenablethespecificaxesrequiredfortheapplicationandsettheservo(andstepper)updateorsamplerate.AnaxisisenabledforoperationbyaTrueinthecorrespondinglocationinthebitmap.Onlyenabledaxesareupdatedandthereisadirectcorrespondencebetweenthenumberofenabledaxesandthefastestupdaterateallowed.
Thefastestupdaterateisonlyachievablewhenallaxesaresingle-feedbackservoaxesandnoextraencodersareenabled.
CautionUpdateratesthataretoofastforthenumberofaxes,stepperoutputs,and/orencodersenabledgenerateanerrorandtheprevioussettingremainsineffect.RefertoErrorsandErrorHandlingforinformationabouterrorsanderrorhandling.
TheEnableAxesVIautomaticallyenablesthefeedbackdevicesmappedtotheenabledaxes.ItisnotnecessarytoexplicitlyenabletheencodersorADCchannelsbeforeenablingtheaxes.AxesmustbekilledbeforetheyaredisabledortheerrorNIMC_wrongModeErrorisgenerated.RefertotheEnableEncodersandEnableADCsVIsformoreinformationaboutenablinganddisablingtheseresourceswhenyouareusingthemnotmappedtoanaxis.
NoteADCchannelscanrateisaffectedbythenumberofchannelsenabled.Thiscouldlimittheeffectiveupdaterate(foraxeswithanalogfeedback).RefertotheEnableADCsVIformoreinformation.CautionIllegallyconfiguredaxescannotbeenabled,andattemptingtodosogeneratesanerror.Forexample,anattempttoenableaservoaxisthatdoesnotatleasthaveitsPrimaryFeedbackdevicemappedgeneratesanerror.
Youalsocansettheupdaterateslowerthanthemaximum.ThisisusefulinmanyapplicationstoscaletheeffectiverangeofthePIDcontrolloopparametersand/ortoimprovestability.RefertotheLoadSinglePIDParameterVIformoreinformationaboutthePIDparametersaffectedbytheupdaterate.
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NI73xxControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwitha73xxmotioncontroller:
TheADCchannelscanrateisaffectedbythenumberofchannelsenabled.Thiscouldlimittheeffectiveupdaterate(foraxeswithanalogfeedback).RefertotheEnableADCsVIformoreinformation.ThisVIisusedtoenablethespecificaxesrequiredfortheapplicationandsettheservo(andstepper)updateorsamplerate.AnaxisisenabledforoperationbyaTrueinthecorrespondinglocationinthebitmap.Onlyenabledaxesareupdatedandthereisadirectcorrespondencebetweenthenumberofenabledaxesandthefastestupdaterateallowed.
NumberofEnabledAxes(7330/40/90)
FastestUpdateRate
NumberofEnabledAxes(7350)
FastestUpdateRate
1 62µs 1–2 62µs2 125µs 3–4 125µs3 188µs 5–6 188µs4 250µs 7–8 250µsThefastestupdaterateisachievableonlywhenallaxesaresingle-feedbackservoaxesandnoextraencodersareenabled.
CautionUpdateratesthataretoofastforthenumberofaxes,stepperoutputs,and/orencodersenabledgeneratesanerrorandtheprevioussettingremainsineffect.RefertoErrorsandErrorHandlingforinformationabouterrorsanderrorhandling.
TheEnableAxesVIautomaticallyenablesthefeedbackdevicesmappedtotheenabledaxes.ItisnotnecessarytoexplicitlyenabletheencodersorADCchannelsbeforeenablingtheaxes.Axesmustbekilledbeforethey
LoadAxisConfigurationParameterLoadsdataonaperaxisbasisforanaxisconfigurationobjectonthemotioncontroller.
DetailsRemarks
DeviceCompatibility
DataisaclusterofvariablesthatcontainsthevaluesfortheselectedAttribute.
Integeris32-bitintegerdata.Doubleis64-bitfloatingpointdata.BooleanisBooleandata.
Attributeistheattributeyouwanttoload:
Enableenablesthecurrentlyselectedaxis.SettheBooleanelementoftheDataclustertoTRUEtoenabletheaxis,andtoFALSEtodisabletheaxis.BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorerusedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.AxisIDistheaxisyouarecontrolling.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralready
UsingThisVI
UsethisVItoloadthedataonaperaxisbasisfortheAxisConfigurationobjectonthemotioncontroller.
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NI73xxControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwitha73xxcontroller:
Becausethenumberofaxesenableddependsonthecontrollooprate,usetheEnableAxesVItoenable/disableanaxisfor73xxcontrollers.
LoadAdvancedControlParameterSetsanadvancedcontrolloopparameterforagivenaxis.
DetailsRemarks
DeviceCompatibility
Valueisthevaluetoloadforthespecifiedparameter.ControlParameterisoneofthefollowingcontrolloopparameterstoset:StaticFrictionModeStaticFrictionMaxDeadzoneStaticFrictionMinDeadzoneStaticFrictionForwardVoltageOffsetStaticFrictionReverseVoltageOffsetPIDRateMultiplierNotchFilterFrequencyNotchFilterBandwidthNotchFilterEnableLowpassFilterCutoffFrequencyLowpassFilterEnableSecondSetofPIDParametersBoardIDisauniquenumberassignedbyMeasurement&Automation
UsingThisVI
UsetheLoadAdvancedControlParameterVItoconfigureanadvancedcontrolloopparameterforagivenaxis.
EnableStaticFrictionModetoconfigurestaticfriction(stiction)compensationonthemotionsystem.Stictioncompensationadjustsforincreasedpowerneededtoovercomestaticfrictionwhenbeginningamovefromastandstill.SetStaticFrictionModeto1toenable,or0todisable,staticfrictioncompensation.
TheMaxandMinDeadzonesarethewindowsaroundthetargetpositionthatdetermineitssensitivitytoexternalforcesthattrytomoveitfromitsposition.Insidethemaximumdeadzonewindow,anaxiscanbemovedwithoutresponse.Assoonasthemovementcausestheaxistoexceedthemaximumdeadzone,thecontrollooprespondsbycorrectingthepositionbacktowithinthewindowdefinedbyminimumdeadzone.Therangeis1to32,767.
ForwardandReverseOffsetVoltagesarethevoltagesnecessarytoovercomestaticfrictionwhenbeginningamove.Thevoltagescanbethesameforbothdirections,butcanbedifferentundersomecircumstances.Forexample,ifanaxismovesagainstgravityinonedirectionandwithgravityintheotherdirection,theoffsetvoltagenecessarytoovercomestaticfrictionagainstgravityishigherthanthatofthedirectionthatmoveswithgravity.
ThePIDRateMultiplierspecifiesamultipliertoslowthePIDRate.Thedefaultis1(nochange),andtherangeis1to10.Forexample,witha250µsPIDRateandaPIDRateMultiplierof4,theeffectivecontrollooprateisshowninthefollowingequation:
effectiverate=PIDRate×PIDRateMultiplier=250µs×4=1ms
Notchfiltersremoveanarrowbandoffrequenciesaroundagivenpointtofilteroutputsignalsthatcouldcausesysteminstability.SetNotchFilterEnableto1toenable,or0todisable,thefilter.UseNotchFilterFrequencytospecifythefrequencyofthesignalthatyouwanttoremove.Therangeforthefrequencyis1HztoPIDRate(inHz)/2.UseNotchFilterBandwidthtospecifythe
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NI73xxControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwitha73xxcontroller:
StaticFrictionandPIDRateMultiplierparameterscanbesetonlyon7340/50motioncontrollers.NotchFilterandLowpassFilterparameterscanbesetonlyon7350motioncontrollers.SecondSetofPIDParametersisvalidonlyon7350controllers.
OnlytheDisabledandSwitchFeedbackoptionsarevalid.IftheSwitchFeedbackoptionisselected,thecontrollooptogglesbetweensetsofPIDparameterseachtimethefeedbackischanged.Forexample,ifyouareusingencoder1,thecontrolloopusestheprimarysetofPIDparameters.IfyouswitchtoADC1,thecontrolloopusesthesecondarysetofPIDparameters.Ifyouswitchbacktoencoder1,thecontrolloopswitchesbacktotheprimarysetofPIDparameters.
NISoftMotionControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwiththeNISoftMotionController:
IftheSwitchFeedbackoptionisselected,thecontrolloopusestheprimarysetofPIDparameterswhenyouuseaprimaryresourceandusesthesecondarysetofPIDparameterswhenyouuseanauxiliaryresource.Forexample,ifyouuseencoder1,thecontrolloopusestheprimarysetofPIDparameters.Ifyouuseauxiliaryencoder1,thecontrolloopusesthesecondarysetofPIDparameters.SecondSetofPIDParametersisnotvalidfortheNISoftMotion
LoadAllPIDParametersLoadsall8PIDcontrolloopparametersforanaxis.
Details
DeviceCompatibility
PIDParametersdatastructurecontainsalleightPIDparametersinthefollowingstructure:
Kp—ProportionalGainKi—IntegralGainIL—IntegrationLimitKd—DerivativeGainTd—DerivativeSamplePeriodKv—VelocityFeedbackGainAff—AccelerationFeedforwardGainVff—VelocityFeedforwardGain
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.AxisistheaxisforwhichtoloadPIDparameters.Validaxisnumbersare1through15forallNImotioncontrollers.Oncontrollerswithlessthaneightaxes,configuringnon-existentaxeshasnoeffect.InpVectindicatesthesourceofthedataforthisVI.Availableinputvectorsincludeimmediate(0xFF),variable(0x01through0x78),or
UsingThisVI
TheLoadAllPIDParametersVIallowsyoutosetall8PIDparametersatthesametimeforagivenaxis.YoucancallthisVIatanytime.However,itistypicallyusedduringinitializationtoconfigureandtuneanaxis.NI-MotionalsooffersaLoadSinglePIDParameterVI,whichyoucanusetochangeanindividualvalueon-the-flywithouthavingtoworryabouttheotherunchangedvalues.
RefertothemotioncontrollerdocumentationforanoverviewofthePIDcontrolloopontheNImotioncontrollerandtotheLoadSinglePIDParameterVIfordescriptionsontheindividualPIDparametersandtheirranges.
NoteIfyouaredoingonboardprogrammingandareusingInpVecttogetthedatathisVIneeds,thisVIreadsthevariablesstartingatthememoryaddresspointedtobyInpVectinthefollowingorder:Kp,Ki,IL,Kd,Td,Kv,Aff,Vff.
LoadingaSecondSetofPIDParameters
ToloadasecondsetofPIDparameters,usetheLoadAllPIDParametersandLoadSinglePIDParameterVIstoloadthesecondsetofPIDvalues.InsteadofusingregularaxisresourceIDs,suchasaxis1=0x1(1),axis2=0x2(2),andsoon,usethefollowingalternateresourceIDs:axis1=0xA1(161),axis2=0xA2(162).
UsetheLoadAdvancedControlParameterVItoenablethenewsetofPIDparametersbasedontheconditionspecifiedinthevalueparameter.
RefertotheRemarkssectionoftheLoadAdvancedControlParametertopicformoreinformationabouthowtochangefeedbackwhiletheaxisisenabled.
LoadCommutationParameterSetsacommutationparameterforagivenaxis.
Details
DeviceCompatibility
Attributeisoneofthefollowingcommutationattributestoset:InitializationTypeFindZeroVoltageFindZeroTimeDirectSetPhaseElectricalCycleCountsHallSensorTypeCommutationModeBoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.Axisistheaxistoconfigure.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
UsingThisVI
UsetheLoadCommutationParameterVItoconfigureacommutationparameterforagivenaxis.
NoteOnly7350controllerssupporttheLoadCommutationParameterVI.
InitializationTypespecifieshowthecontrollerinitializesthecommutationphase.Selectoneofthefollowingvalues:
Value Description0 HallSensor—InitializesthephasebasedontheHallsensor'sinput.
1 ShakeandWake—Initializesthephasebydrivingthesystemtothezerodegreecommutationphase.
2 DirectSet—Setsthecommutationphasedirectlywiththephaseanglespecified.
CautionPhaseinitializationisperformedwhentheaxesareenabled.IfyouuseShakeandWake,thesystemcanmoveduringtheinitializationprocess.
FindZeroVoltagespecifiesthevoltagetousewithShakeandWakeinitialization.Therangeis0to10.FindZeroTimespecifiesthedurationofShakeandWakeinitializationinmilliseconds.Therangeis0to10,000ms.
DirectSetPhasespecifiesphaseangletosetwithDirectSetinitialization.ForDirectSet,thecontrollersetsthecurrentpositionasthespecifiedphaseangle.NationalInstrumentsrecommendsthisinitializationmethodonlyforcustomsystemswithaknowninitialphaseangle.Therangeforthephaseangleis0to359°.
ElectricalCycleCountsspecifiestheencodercountsforthecommutationcycle.Thisinformationisusuallylistedinthemotororstagedocumentation.Somemotormanufacturerspresentthisinformationasthenumberofpoles.Insuchcases,convertnumberofpolestocountsperelectricalcyclewiththefollowingequation.Therangeis2to268,435,000counts.
LoadCounts/StepsperRevolutionLoadsthequadraturecountsorstepsperrevolutionforanaxis.
DetailsRemarks
DeviceCompatibility
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.Axisistheaxistocontrol.Counts(Steps)/Reviseitherthequadraturecountsperrevolutionfortheencodermappedtotheaxisorthenumberofsteps(full,half,ormicrostep)permotorrevolution.Thedefaultis2,000.UnitTypeisthetypeofinformation,countsorsteps,toload.Thedefaultiscounts.
Validvaluesare:
Counts—Usetodefinecounts/revolutionforaquadratureencoder.
Steps—Usetodefinesteps/revolutionforasteppermotor.
errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassesthe
UsingThisVI
UsetheLoadCounts/StepsperRevolutionVItoloadanyfeedbackvalue(countsorvolts)perunitofmeasureortoloadthenumberofstepspermotorrevolution.Forencoders,thisistypicallyinunitsofquadraturecountspermotorrevolution,butcanbecountsperinch,percm,orperanyunitofmeasure.Foranalogfeedback,itcanbeinunitsofscaledvoltage.Stepscanbefullsteps,halfsteps,ormicrostepsdependinguponhowyouhavetheexternalstepperdriverandmotorconfigured.
ThisparametermustbecorrectlyloadedbeforeyoucalltheLoadVelocityinRPM,LoadAccel/DecelinRPS/sec,LoadVelocityThresholdinRPM,ReadVelocityinRPM,LoadMoveConstraints,orFindReferenceVIs.
TheFindReferenceVIsearchesfortheencoderindexforonerevolutionasdefinedbythisVI.Therefore,anotherusefulunitofmeasureiscountsperindexperiod.Linearencodersoftenhaveindexeseveryinchoreverycentimeter.
Closed-loopstepperfunctionalityreliesontheratioofcountstostepsandnotontheabsolutevaluesofcountsorstepsperrevolution.Forclosed-loopoperation,anyunitofmeasure(UOM)thatallowsyoutoenterbothcountsperUOMandstepsperUOMthatarewithintheirvalidrangeswork.NoticethatthisVImustbecalledtwice:onetimetosetupthesteppermotorsteps/rev,andagaintosetupthequadratureencodercounts/rev.
CautionForclosed-loopsteppercontrollers,stepsperrevolution/countsperrevolutionmustbeintherangeof1/32,767<steps/counts<32,767.
TheLoadCounts/StepsperRevolutionVIsimplyloadsascalefactorthataffectssubsequentlyloadedandreadbackvaluesofvelocityandacceleration.
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NI73xxControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwitha73xxcontroller:
Counts(Steps)/RevisinterpretedasnumberofencodercountsperrevolutionforencoderfeedbackornumberofADCcodes(LSBs)perrevolutionforanalogfeedback.TherangefortheCounts(Steps)/Revparameteris2to228–1withadefaultvalueof2,000.
NISoftMotionControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwiththeNISoftMotionController:
TherangefortheCounts(Steps)/Revparameteris1to231–1withadefaultvalueof1.
NoteThisparametermustbecorrectlyloadedbeforeyouloadtargetpositionsorwritecontourpositioninformationtothecontrollerorcammingtable.
ThisVIdeterminestheunitusedwhenloadingvelocity.YoumustsettheCounts(Steps)/Revvalueto1tousethisVItoloadvelocityvaluesincounts/secandloadaccelerationvaluesincounts/sec2.IfyousetCounts(Steps)/Revtoanyvalueotherthan1,youmustusetheLoadMoveConstraintsVItoloadvelocityandaccelerationincounts.
LoadSinglePIDParameterLoadsasinglePIDcontrolloopparameterforanaxis.
Details
DeviceCompatibility
Value(0)isthevaluetoloadfortheselectedPIDparameter.
PIDParameter Abbreviation DataRange DefaultProportionalGain Kp 0to32,767 100IntegralGain Ki 0to32,767 0IntegrationLimit Ilim 0to32,767 1,000DerivativeGain Kd 0to32,767 1,000DerivativeSamplePeriod Td 0to63 2VelocityFeedbackGain Kv 0to32,767 0AccelerationFeedforwardGain Aff 0to32,767 0VelocityFeedforwardGain Vff 0to32,767 0Parameter(Kp)istheselectorforthePIDparametertoload.BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.AxisistheaxisforwhichtoloadPIDparameters.Validaxisnumbersare1through15forallNImotioncontrollers.Oncontrollerswithlessthaneightaxes,configuringnon-existentaxeshasnoeffect.
UsingThisVI
ThisVIexpectstobegiventheparametersinthefollowingorder:Axis,Parameter,Value.
RefertothemotioncontrollerdocumentationforanoverviewoftheenhancedPIDcontrolloopontheNImotioncontroller.TheLoadSinglePIDParameterVIallowsyoutochangeanindividualPIDvalueon-the-flywithouthavingtoworryabouttheotherunchangedPIDvalues.
Example
ToloadaKpof1,000toanaxis2,calltheLoadSinglePIDParameterVIwiththefollowingparameters:
Axis=2Parameter=KpValue=1,000InpVect=0xFF(Immediate)
NoteIfyouaredoingonboardprogrammingandareusingInpVecttogetthedatathisVIneeds,rememberthatthisVIreadsthevariablesstartingatthememoryaddresspointedtobyInpVectinthefollowingorder:Parameter,Value.
LoadingaSecondSetofPIDParameters
ToloadasecondsetofPIDparameters,usetheLoadAllPIDParametersandLoadSinglePIDParameterVIstoloadthesecondsetofPIDvalues.InsteadofusingregularaxisresourceIDs,suchasaxis1=0x1(1),axis2=0x2(2),andsoon,usethefollowingalternateresourceIDs:axis1=0xA1(161),axis2=0xA2(162).
UsetheLoadAdvancedControlParameterVItoenablethenewsetofPIDparametersbasedontheconditionspecifiedinthevalueparameter.
LoadVelocityFilterParameterSetsthevelocityFilterTimeConstantforthedigitalsingle-polelowpassfilterusedtoaveragetheinstantaneousaxisvelocity.
DetailsRemarks
DeviceCompatibility
UpdateIntervalisthemaximumvelocityupdateperiodinms.Therangeforthisparameteris1to2,500ms.FilterDistanceisthenumberofpositionchangesincounts/stepsnecessaryforavelocitytobereported.Therangeforthisparameterisfrom0to1,000counts/steps.BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.Axisistheaxistoconfigure.InpVectcontainsthedistanceandintervalparametersthatarethesourceofthedataforthisVI.
Availableinputvectorsincludeimmediate(0xFF),variable(0x01through0x78),orindirectvariable(0x81through0xF8).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralready
UsingThisVI
ThisVIconfigurestheinternalfilterforvelocityreporting.Thereportedvelocitycanoscillateduetofeedbackquantizationerror,noise,andjitterysystems,renderingthedatauseless.Youcanapplyafilterovermultipledatasamplestocalculateanaveragevelocitythatreflectstheactualsystembehavior.ThisfilterisrepresentedbyFilterDistance.ThelargertheFilterDistance,themorepositionchangesaccumulatetoperformvelocitycalculation.Thisisusuallybetterforanoisysystem.
AlargeFilterDistancecanintroducealongerdelayinvelocityreportingasthepositionchangesaccumulate.Tolimitthisdelayandsluggishdatareading,specifyaminimumupdateintervalusingtheUpdateIntervalparameter.TheaxisvelocityisupdatedwithinthisupdateintervaliftheFilterDistancerequirementisnotmet.
NoteVelocityquantizationnoiseisameasurement-onlyphenomenonanddoesnotaffecttheabilityofthemotioncontrollertoaccuratelycontrolvelocityandpositionduringamove.
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NISoftMotionControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwiththeNISoftMotionController:
FortheInpVectparameter,theNISoftMotionControllersupportsonlytheimmediatereturnvector(0XFF).
SetStepperLoopModeSetsastepperaxistooperateineitheropen-loop,closed-loop,orP-Commandmode.
Details
DeviceCompatibility
LoopMode(Open)setsthemodeforthestepperaxis.BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.AxisistheaxisforwhichtoloadPIDparameters.Validaxisnumbersare1through15forallNImotioncontrollers.Oncontrollerswithlessthaneightaxes,configuringnon-existentaxeshasnoeffect.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.UsetheerrorhandlerVIstolookupthemeaningof
UsingThisVI
Youcanoperatestepperaxesinbothopenandclosed-loopmodes.Inopen-loopmode,thestepperaxiscontrolsthetrajectoryprofileandgeneratesstepsbuthasnofeedbackfromthemotororactuatortodetermineiftheprofileisfollowedcorrectly.
Inclosed-loopmode,thefeedbackpositionisconstantlycomparedtothenumberofstepsgeneratedtoseeifthesteppermotorismovingcorrectly.Whenthetrajectoryprofileiscomplete,missingsteps(ifany)aremadeupwithapull-inmove.If,atanytimeduringthemove,thedifferencebetweentheinstantaneouscommandedpositionandthefeedbackpositionexceedstheprogrammedfollowingerrorlimit,theaxisiskilledandmotionstops.
YouuseP-Commandmodeforsystemsinwhichaservodrivereceivesstep/dir(CW/CCW)fromthemotioncontroller.ThedriveclosesthePIDloop,andthemotioncontrollergeneratesthetrajectory.Similartoclosed-loopmode,inP-Commandmode,theaxisiskilledwhentheprogrammedfollowingerrorlimitisexceeded.
CautionForproperclosed-loopandP-Commandoperation,thecorrectvaluesforsteps/revandcounts/revmustbeloadedwiththeLoadCounts/StepsperRevolutionVI.Incorrectcountstostepsratiocanresultinfailuretoreachthetargetpositionanderroneousclosed-loopstepperoperation.
Tooperateinclosed-looporP-Commandmode,astepperaxismusthaveaprimaryfeedbackresource,suchasanencoder,mappedtoitpriortoenablingtheaxis.RefertotheConfigureAxisResourcesVIformoreinformationaboutfeedbackresources.Youcanoperateanaxiswithaprimaryfeedbackresourceinopen-loop,closed-loop,orP-Commandmodeandyoucanswitchthemodeatanytime.Youcanstillreadthepositionofthemappedfeedbackresourceevenwhentheaxisisinopen-loopmode.
TrajectoryControlVIsThisVIgroupcontainsdetaileddescriptionsofVIsusedtosetupandcontrolmotiontrajectoriesontheNImotioncontroller.ItincludesVIstoloaddouble-bufferedtrajectoryparameters,readbackinstantaneousvelocity,positionandtrajectorystatus,aswellasVIstoconfigureblending,gearing,andotheradvancedtrajectoryfeatures.
Doublebufferedparametersforaxesandvectorspacesincludeacceleration,deceleration,velocity,s-curve,operationmode,targetposition,andcircular,helical,andsphericalarcparameters.Youcansendtheseparameterstothecontrolleratanytime,buttheydonottakeeffectuntilyouexecutethenextStartMotionorBlendMotionVI.Thisdoublebufferingallowsyoutosetupmovesaheadoftime,synchronizingthemwithasingleStartMotionorBlendMotioncall.
OthertrajectoryVIsallowyoutoconfiguretheoperationoftrajectorygeneratorsandsetstatusthresholds.Theseparametersincludefollowingerror,blendfactor,gearmaster,ratioandenable,positionmodulus,velocitythreshold,torquelimit,torqueoffset,andsoftwarelimitpositions.Unlikedouble-bufferedparameters,ifyouchangetheseparametersonthefly,theytakeeffectimmediately.AlsointhiscategoryareVIstoresetpositiontozerooranotherspecifiedvalueandtoforceavelocityoverride.
Duringamove,youcanreadtheinstantaneousvaluesofposition,velocity,followingerror,andDACoutput(torque).TherearealsoVIstoreadthefollowingtrajectorystatus:movecomplete,profilecomplete,blendcomplete,motoroff,followingerrortrip,velocitythreshold,andDAClimitstatus.Thesetrajectoryvaluesandstatusareusedformovesequencing,systemcoordination,andoverallmonitoringpurposes.
Finally,NI-MotionoffersasetofVIstoacquiretime-sampledpositionandvelocitydataintoalargeonboardbufferandthenlaterreaditoutforanalysisanddisplay.TheseVIsimplementadigitaloscilloscopethatisusefulduringsystemsetup,PIDtuning,andgeneralmotionwithdataacquisitionsynchronization.
ClicktheiconsforVIdescriptions.
LoadTargetPosition ReadPositionLoadVectorSpacePosition ReadVectorSpacePositionLoadVelocity ReadVelocityLoadAcceleration/Deceleration ReadVelocityinRPMSetOperationMode CheckBlendCompleteStatusResetPosition CheckMoveCompleteStatusLoadMoveConstraint WaitforBlendCompleteReadperAxisStatus WaitforMoveComplete
Subpalettes
ArcVIs
GearingandCammingVIs
BufferedOperationsVIs
AdvancedTrajectoryVIs
CheckBlendCompleteStatusCheckstheblendcompletestatusforanaxis,vectorspace,groupofaxes,orgroupofvectorspaces.
Details
DeviceCompatibility
Axis/VSMapisthebitmapofaxesorvectorspacestocheck.ItisonlyrequiredwhenmultipleaxesorvectorspacesareselectedwiththeAxisorVectorSpaceparameter.Otherwise,thisparameterisignored.
Whencheckingmultipleaxes(Axis/VSMap=AxisControl):
Axis1—Iftrue,blendmustbecompleteonthespecifiedaxis.Iffalse,blendcanbeeithercompleteornotcompleteonthespecifiedaxis(donotcare).Axis2—Iftrue,blendmustbecompleteonthespecifiedaxis.Iffalse,blendcanbeeithercompleteornotcompleteonthespecifiedaxis(donotcare).Axis3—Iftrue,blendmustbecompleteonthespecifiedaxis.Iffalse,blendcanbeeithercompleteornotcompleteonthespecifiedaxis(donotcare).Axis4—Iftrue,blendmustbecompleteonthespecifiedaxis.Iffalse,blendcanbeeithercompleteornotcompleteonthespecifiedaxis(donotcare).Axis5—Iftrue,blendmustbecompleteonthespecifiedaxis.If
UsingThisVI
ThisVIextendsthefunctionalityoftheReadBlendStatusVI,suchthatyoucandefineacombinationofaxesorvectorspacestocheckasagroup.Italsocanchecktheblendcompletestatusforasingleaxisorvectorspace,muchthesameasReadBlendStatus.InsteadofdecodingtheoutputoftheReadBlendStatusVIyourself,thisVIdoesthatforyoubycomparingtheaxesorvectorspacesspecifiedintheAxisorVectorSpaceandAxis/VSMapinputparameterswiththeblendcompletestatusfortheappropriateaxesorvectorspaces.Theoutputisasingletrue/falsevalueindicatingwhetherornotthespecifiedblendorblendsarecomplete.
ThisVIdoesnotcheckforfollowingerrorstatusoraxisoffstatus.Checkingforfaultsduringmovesisrecommended.Todothis,useReadperAxisStatus,whichreturnsfollowingerrorandaxisoffstatusinadditiontothemovecompletestatus.RefertotheNI-MotionHelpformoreinformationandexamplecode.
Formoreinformationaboutblendcompletestatus,refertotheReadBlendStatusVI.
NoteRefertoVIExecutionTimesforbenchmarktiminginformationaboutyourcontroller.
CheckMoveCompleteStatusChecksthemovecompletestatusforanaxis,vectorspace,groupofaxes,orgroupofvectorspaces.
Details
DeviceCompatibility
Axis/VSMapisthebitmapofaxesorvectorspacestocheck.ItisonlyrequiredwhenmultipleaxesorvectorspacesareselectedwiththeAxisorVectorSpaceparameter.Otherwise,thisparameterisignored.
Whencheckingmultipleaxes(Axis/VSMap=AxisControl):
Axis1—Iftrue,movemustbecompleteonthespecifiedaxis.Iffalse,movecanbeeithercompleteornotcompleteonthespecifiedaxis(donotcare).Axis2—Iftrue,movemustbecompleteonthespecifiedaxis.Iffalse,movecanbeeithercompleteornotcompleteonthespecifiedaxis(donotcare).Axis3—Iftrue,movemustbecompleteonthespecifiedaxis.Iffalse,movecanbeeithercompleteornotcompleteonthespecifiedaxis(donotcare).Axis4—Iftrue,movemustbecompleteonthespecifiedaxis.Iffalse,movecanbeeithercompleteornotcompleteonthespecifiedaxis(donotcare).Axis5—Iftrue,movemustbecompleteonthespecifiedaxis.If
UsingThisVI
ThisVIextendsthefunctionalityoftheReadTrajectoryStatusVI,suchthatyoucandefineacombinationofaxesorvectorspacestocheckasagroup.Italsocancheckthemovecompletestatusforasingleaxisorvectorspace,muchthesameasReadBlendStatus.InsteadofdecodingtheoutputoftheReadTrajectoryStatusVIyourself,thisVIdoesthatforyoubycomparingtheaxesorvectorspacesspecifiedintheAxisorVectorSpaceandAxisorVSMapinputparameterswiththemovecompletestatusfortheappropriateaxesorvectorspaces.Theoutputisasingletrue/falsevalueindicatingwhetherornotthespecifiedmoveormovesarecomplete.
ThisVIdoesnotcheckforfollowingerrorstatusoraxisoffstatus.Checkingforfaultsduringmovesisrecommended.Todothis,useReadperAxisStatus,whichreturnsfollowingerrorandaxisoffstatusinadditiontothemovecompletestatus.RefertotheNI-MotionHelpformoreinformationandexamplecode.
Formoreinformationaboutmovecompletestatus,refertotheReadTrajectoryStatusandConfigureMoveCompleteCriteriaVIs.
NoteRefertoVIExecutionTimesforbenchmarktiminginformationaboutyourcontroller.
LoadAcceleration/DecelerationLoadsthemaximumaccelerationand/ordecelerationvalueforanaxisorvectorspace.
DetailsRemarks
DeviceCompatibility
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.AxisorVectorSpaceistheaxisorvectorspacetocontrol.InpVectindicatesthesourceofthedataforthisVI.Availableinputvectorsincludeimmediate(0xFF),variable(0x01through0x78),orindirectvariable(0x81through0xF8).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroora
UsingThisVI
TheLoadAccelerationVIspecifiesthemaximumrateofaccelerationand/ordecelerationforindividualaxesorvectorspaces.Whenexecutedonavectorspace,thevaluecontrolsthevectoracceleration(deceleration)alongthevectormovepath.
YoucanusethisVItoloadseparatelimitsforaccelerationanddecelerationortosetthembothtothesamevaluewithonecall.Theseparametersaredouble-bufferedsoyoucanloadthemontheflywithoutaffectingthemoveinprocess,andtheytakeeffectonthenextStartorBlendMotioncall.Aftertheyareloaded,theseparametersremainineffectforallsubsequentmotionprofilesuntilre-loadedbythisVI.Youdonotneedtoloadaccelerationbeforeeachmoveunlessyouwanttochangetheaccelerationand/ordeceleration.
Accelerationdefineshowquicklytheaxisoraxescomeuptospeedandistypicallylimitedtoavoidexcessivestressonthemotor,mechanicalsystem,and/orload.Aseparate,slowerdecelerationisusefulinapplicationswherecomingtoagentlestopisimportant.
NoteUseLoadMoveConstraintstoloadanaccelerationoflessthan1count/s2.
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NI73xxControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwitha73xxmotioncontroller:
Accelerationanddecelerationvaluesareconvertedtoaninternal16.16fixed-pointformatinunitsofcounts/s2beforebeingusedbythetrajectorygenerator.Youcancalculatetheminimumaccelerationincrementwiththefollowingformula:
minimumacceleration/deceleration=Amin×( )2
where:Aminis1/65,536counts/sample2orsteps/sample2,Tsisthesampleperiodinsecondspersample.Foratypicalservoaxiswith2,000countsperrevolutionoperatingatthe250msupdaterate,calculatetheminimumacceleration/decelerationincrementusingthefollowingequation:
× =0.122070counts/sYoucancalculatethemaximumacceleration/decelerationusingthefollowingequation:
maximumacceleration/deceleration=Amax×( )2
where:Amaxis32counts/sample,Tsisthesampleperiodinsecondspersample,andisconstrainedaccordingtothefollowingequations:
acceleration 256×decelerationdeceleration 65536×accelerationIfyouaredoingonboardprogrammingandareusingInpVecttogetthe
LoadTargetPositionLoadsthetargetpositionforthenextaxismove.
Details
DeviceCompatibility
TargetPosition(0)isthetargetpositionforthenextaxismoveincounts(servoaxes)orsteps(stepperaxes).Targetpositionscanbeanywherewithinthe32-bitpositionrange,–(231)to+((231)–1).Thedefaultvaluefortargetpositioniszero(0).
CautionAnysinglemoveislimitedto±(231–1)countsorsteps.AnerrorisgeneratedifyouexceedthislimitbyloadingatargetpositiontoofarfromthecurrentAxisposition.
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.Axisistheaxistocontrol.InpVectindicatesthesourceofthedataforthisVI.Availableinputvectorsincludeimmediate(0xFF),variable(0x01through0x78),orindirectvariable(0x81through0xF8).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassesthe
UsingThisVI
TheLoadTargetPositionVIloadsatargetpositiontothespecifiedaxis.Targetpositionscanbeforsingleaxismoves,multi-axiscoordinatedmoves,orvectorspacemoves.Positionvaluesindicatetheendlocationanddirectionofmotion(targetposition).
NoteRefertotheLoadVectorSpacePositionVIforaneasywaytoloaduptothreetargetpositionsforavectorspaceinonecall.
Targetpositionisdouble-bufferedsoyoucanloaditontheflywithoutaffectingthemoveinprocess,andittakeseffectonthenextStartorBlendMotionVI.Whenthetargetpositionisloaded,itisinterpretedaseitheranabsolutetargetposition,arelativetargetposition,atargetpositionrelativetothelastcapturedpositionorwiththeeffectofapositionmodulus,dependingonthemodesetwiththeSetOperationModeVI.
Thismeansthatifyousettheoperationmodeto"relativetocapture,"youmustloadthetargetpositionafterthecapturehasoccurredbecausethepositionisevaluatedonload.
Afteryouexecutethestartorblend,theaxisoraxesfollowtheprogrammedtrajectoryandendupattheabsolute,relative,ormodulotargetposition.
NoteRefertoVIExecutionTimesforbenchmarktiminginformationaboutyourcontroller.
LoadVectorSpacePositionLoadstheaxistargetpositionsforthenextvectorspacemove.
Details
DeviceCompatibility
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.VectorSpaceisthevectorspacetocontrol.InpVectindicatesthesourceofthedataforthisVI.Availableinputvectorsincludeimmediate(0xFF),variable(0x01through0x78),orindirectvariable(0x81through0xF8).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,
UsingThisVI
TheLoadVectorSpacePositionVIloadsuptothreeaxistargetpositionsforthevectorspacespecified.ThisVIisidenticaltocallingtheLoadTargetPositionVIuptothreetimes,onetimepereachaxisinthevectorspace.Positionvaluesindicatetheendlocationanddirectionofmotion(targetposition).
Targetpositionsaredouble-bufferedsoyoucanloadthemontheflywithoutaffectingthemoveinprocess,andtheytakeeffectonthenextStartorBlendMotionVI.Whenthetargetpositionsareloaded,theyareinterpretedaseitherabsolutetargetpositions,relativetargetpositions,targetpositionsrelativetothelastcapturedpositionsorwiththeeffectofapositionmodulus,dependingonthemodesetwiththeSetOperationModeVI.
Thismeansthatifyousettheoperationmodeto"relativetocapture,"youmustloadthetargetpositionafterthecapturehasoccurredbecausethepositionisevaluatedonload.
Afteryouexecutethestartorblend,theaxesinthevectorspacefollowtheprogrammedtrajectoryandendupattheabsolute,relative,ormodulotargetpositions.
NoteIfthevectorspacecontainslessthanthreeaxes,theextratargetpositionvaluesareignored.NoteIfyouaredoingonboardprogrammingandareusingInpVecttogetthedatathisVIneeds,rememberthatthisVIreadsthevariablesstartingatthememoryaddresspointedtobyInpVectinthefollowingorder:XPosition,YPosition,ZPosition.NoteRefertoVIExecutionTimesforbenchmarktiminginformationaboutyourcontroller.
LoadVelocityLoadsthemaximumvelocityforanaxisorvectorspace.
DetailsRemarks
DeviceCompatibility
Velocityisthetargetormaximumvelocityincounts/s(servoaxes)orsteps/s(stepperaxes).Thedefaultis10000.BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.AxisorVectorSpaceistheaxisorvectorspacetocontrol.InpVectindicatesthesourceofthedataforthisVI.Availableinputvectorsincludeimmediate(0xFF),variable(0x01through0x78),orindirectvariable(0x81through0xF8).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroora
UsingThisVI
TheLoadVelocityVIspecifiesthemaximumtrajectoryvelocityforindividualaxesorvectorspaces.Whenexecutedonavectorspace,thevaluecontrolsthevectorvelocityalongthevectormovepath.Forvelocitycontrolapplications,thesignoftheloadedvelocityspecifiesthemovedirection.
Velocityisadouble-bufferedparametersoyoucanloaditontheflywithoutaffectingthemoveinprocess,andittakeseffectonthenextStartorBlendMotioncall.Afteritisloaded,thisparameterremainsineffectforallsubsequentmotionprofilesuntilre-loadedbythisVI.Youdonotneedtoloadvelocitybeforeeachmoveunlessyouwanttochangethevelocity.
NoteUseLoadMoveConstraintstoloadavelocityoflessthan1count/sec.NoteThevelocityloadedwiththisVIisthemaximummovevelocity.ActualvelocityattainableisdeterminedbymanyfactorsincludingPIDtuning,lengthofmove,accelerationanddecelerationvalues,andphysicalconstraintsoftheamplifier/motor/mechanicalsystem.NoteRefertoVIExecutionTimesforbenchmarktiminginformationaboutyourcontroller.
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NI73xxControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwitha73xxmotioncontroller:
Velocityvaluesincounts/sorsteps/sarealsoconvertedtotheinternal16.16fixed-pointformatinunitsofcountsorstepspersample(update)periodbeforebeingusedbythetrajectorygenerator.Althoughthemotioncontrollercancontrolvelocityto1/65,536ofacountorsteppersample,itisimpossibletoloadavaluethatsmallwiththeLoadVelocityVI,asshowninthefollowingformula:
Velocityincountsorstep/s=Vmin×( )
where:Vminis1/65,536counts/sampleorsteps/sample,andTsisthesampleperiodinsecondspersample.
Evenatthefastestupdaterate,
Ts=625×10-6
×16,000=0.244countsorsteps/s
Youcancalculatethemaximumvelocitywiththefollowingequation:
maximumvelocity=Vmax
where:Vmax=20MHzforservos,8MHzforsteppersona7350controller,4MHzforsteppersona7330/40/90controller,
ReadPositionReadsthepositionofanaxis.
Details
DeviceCompatibility
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.Axisistheaxistoread.RetnVectindicatesthedestinationforthereturndatageneratedbythisVI.Availablereturnvectorsincludereturndatatothehost(0xFF),toavariable(0x01through0x78),toanindirectvariable(0x81through0xF8),anddonotreturndata(0).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.UsetheerrorhandlerVIstolookupthemeaningofthiscodeanddisplaythecorrespondingerrormessage.
UsingThisVI
TheReadPositionVIreturnstheinstantaneouspositionofthespecifiedaxis.Forservoaxes,itreturnstheprimaryfeedbackpositionincounts.Foropen-loopstepperaxes,itreturnsthenumberofstepsgenerated.Forclosed-loopstepperaxes,itconvertstheprimaryfeedbackpositionfromcountstostepsandthenreturnsthevalueinsteps.Closed-loopstepperaxesrequireyoutocorrectlyloadvaluesofstepsperrevolutionandcountsperrevolutiontofunctioncorrectly.
NoteForclosed-loopaxes,thisVIalwaysreturnsthepositionoftheprimaryfeedbackresource.TipRefertotheReadVectorSpacePositionVIforaneasywaytoreaduptothreeaxispositionsforavectorspaceinonecall.NoteRefertoVIExecutionTimesforbenchmarktiminginformationaboutyourcontroller.
ReadperAxisStatusReadsthemotionstatusonaper-axisbasis.
DetailsRemarks
DeviceCompatibility
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.Axisistheaxistoread.RetVectindicatesthedestinationforthereturndatageneratedbythisVI.Availablereturnvectorsincludereturndatatothehost(0xFF),returndatatoavariable(0x01through0x78),returndatatoanindirectvariable(0x81through0xF8),anddonotreturndata(0).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,
UsingThisVI
TheReadPerAxisStatusVIreturnsthetrajectoryandmotionI/Ostatusforthespecifiedaxis.ItalsoreturnsthesuccessorfailurestatusofthemostrecentFindReferencesequence.
NoteThisVIreturnsundefinedvaluesforaxesthatarecurrentlyperformingfindreferencemoves.NoteYoualsocanreadindividualitemstatusinamulti-axisformatwithNI-MotionVIslikeReadLimitStatus,ReadTrajectoryStatus,andsoon.
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NI73xxControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwitha73xxmotioncontroller:
InthePerAxisH/WStatusbitmap,D7CommunicationWatchdog(WD)isnotsupportedby73xxcontrollers.
NISoftMotionControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwiththeNISoftMotionController:
WhenyouareusingtheNISoftMotionControllerwithadevicethatsupportsmultiplehigh-speedcapturesandbreakpoints,thestatusforprimaryandsecondaryinputsisconcatenatedbyalogicalORoperationtopopulatePerAxisH/WStatus.InthePerAxisH/WStatusbitmap,WatchdogisusedforacommunicationstatuswatchdogontheNISoftMotionController.
ReadVectorSpacePositionReadsthepositionofallaxesinavectorspace.
Details
DeviceCompatibility
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.VectorSpaceisthevectorspacetoread.RetnVectindicatesthedestinationforthereturndatageneratedbythisVI.Availablereturnvectorsincludereturndatatothehost(0xFF),toavariable(0x01through0x78),toanindirectvariable(0x81through0xF8),anddonotreturndata(0).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,
UsingThisVI
TheReadVectorSpacePositionVIreturnstheinstantaneouspositionsoftheaxesinthespecifiedvectorspace.Forservoaxes,itreturnstheprimaryfeedbackpositionincounts.Foropen-loopstepperaxes,itreturnsthenumberofstepsgenerated.Forclosed-loopstepperaxes,itconvertstheprimaryfeedbackpositionfromcountstostepsandthenreturnsthevalueinsteps.Closed-loopstepperaxesrequirecorrectlyloadedvaluesofstepsperrevolutionandcountsperrevolutiontofunctioncorrectly.
NoteForclosed-loopaxes,thisVIalwaysreturnsthepositionoftheprimaryfeedbackresource.NoteIfyouaredoingonboardprogrammingandareusingRetnVecttowritedata,thisVIwritesthevariablesstartingatthememoryaddresspointedtobyRetnVectinthefollowingorder:XPosition,YPosition,ZPosition.
ReadVelocityReadsthefilteredvelocityofanaxisorvectorspace.
Details
DeviceCompatibility
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.AxisorVectorSpaceistheaxisorvectorspacetoread.RetnVectindicatesthedestinationforthereturndatageneratedbythisVI.Availablereturnvectorsincludereturndatatothehost(0xFF),toavariable(0x01through0x78),toanindirectvariable(0x81through0xF8),anddonotreturndata(0).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.UsetheerrorhandlerVIstolookupthemeaningof
UsingThisVI
ThisVIreturnstheaxisorvectorspacefilteredvelocity.Toreducetheeffectsofnoiseandjitteronthefiltercalculation,thedatathisVIreturnsisaveragedbasedonparameterssetintheLoadVelocityFilterParameterVI.
Forvectorspaces,thisVIreturnsvectorvelocity,theroot-mean-squareofthefilteredvelocitiesoftheindividualaxesthatmakeupthevectorspace.
NoteYoualsocanreadvelocityinRPMbycallingtheReadVelocityinRPMVI.NoteRefertoVIExecutionTimesforbenchmarktiminginformationaboutyourcontroller.
ReadVelocityinRPMReadsthefilteredvelocityofanaxisorvectorspaceinRPM.
Details
DeviceCompatibility
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.AxisorVectorSpaceistheaxisorvectorspacetoread.RetnVectindicatesthedestinationforthereturndatageneratedbythisVI.Availablereturnvectorsincludereturndatatothehost(0xFF),toavariable(0x01through0x78),toanindirectvariable(0x81through0xF8),anddonotreturndata(0).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,
UsingThisVI
ThisVIreturnstheaxisorvectorspacefilteredvelocityinRPM.Thefilteredvelocityismeasuredbasedontimeelapsedbetweenpositionchanges.Toavoidquantizationerrorandjitterinthemechanicalsystem,afilteringalgorithminLoadVelocityFilterParameterisperformedwithparametersconfigured.
Forvectorspaces,thisVIreturnsvectorvelocity,theroot-mean-squareofthefilteredvelocitiesoftheindividualaxesthatmakeupthevectorspace.
NoteThisVIrequirespreviouslyloadedvaluesofeithercountsperrevolution(forservoaxes)orstepsperrevolution(forstepperaxes)tooperatecorrectly.NoteRefertoVIExecutionTimesforbenchmarktiminginformationaboutyourcontroller.
ResetPositionResetstheaxispositiontothespecifiedposition,takingfollowingerrorintoaccount.
NoteIfyouareusingthisVIwithanNI7350orNI7390devicethatyouarereadingpositionson,itmighttakeupto5msfortheapplicationtodisplaythemostrecentlyreadpositionafteryoucallthisVI.
DetailsRemarks
DeviceCompatibility
PrimaryResetPosition(0)istheresetvaluefortheaxisanditsassociatedprimaryfeedbackresource,takingfollowingerrorintoaccount.Youcanresetpositiontoanyvalueinthetotalpositionrangeof–(231)to+(231–1).Thevalueisinstepsforsteppersystemsandcountsforservosystems.SecondaryResetPosition(0)istheresetvaluefortheoptionalsecondaryfeedbackresource.Youcanresetpositiontoanyvalueinthetotalpositionrangeof–(231)to+(231–1).
NoteForstepperclosed-loopconfigurations,wheretheencodercountsperrevolutionisgreaterthanthestepsperrevolution,therangeofthepositionparametersisreducedbytheratioofcounts/revtosteps/rev.Forexample,iftheratiois4,000countsperrevolutionto2,000stepsperrevolution(2:1ratio),thentherangeofpositionparametersisdividedby2.
UsingThisVI
Thisfunctionresetstheaxispositionandtheassociatedprimaryfeedbackposition,takingfollowingerrorintoaccount,andresetstheoptionalsecondaryfeedbackposition.Thismeansthatifyouresetthepositionto0andhaveafollowingerrorof15,thefeedbackpositionis–15.
Youcanresetpositiontozerooranyvalueinthe32-bitpositionrange.Youcanresetthesecondaryfeedbacktothesamevalueastheaxisandprimaryfeedbackoryoucanresetittoadifferentvalue.Ifasecondaryfeedbackresourceisnotinuse,thecorrespondingresetvalueisignored.Ifyouusethesamefeedbackdeviceforbothprimaryandsecondaryfeedback,youmustresetthepositionstobethesamevalue.
NoteNon-zeroresetvaluesareusefulfordefiningapositionreferenceoffset.
Positioncanberesetatanytime.However,itisrecommendedthatyouresetpositiononlywhiletheaxisisstopped.Anaxisresetwhiletheaxisismovingdoesnothavearepeatablereferenceposition.
NoteForaxesinp-commandmode,ensurethattheaxisisnotmovingbeforecallingResetPosition.CallingResetPositionwhentheaxisismovingintroducespositionerrorintothesystem.
Typically,youexecutetheResetPositionVIonetimeaftertheFindHomeandFindIndexsequencesoftheFindReferenceVIhavecompletedsuccessfullytosetthezeropositionforthesystemandnotagainuntilthenextpower-up.
AnADCchannelusedasaprimaryfeedbackresourcesisresetbystoringanoffsetvaluewhenthisVIisexecuted.Inthisway,itszeroreferenceisnotlostandyoucanstillreadtheactualADCvaluewiththeReadADCsVI.
NoteIfyouaredoingonboardprogrammingandareusingInpVecttogetthedatathisVIneeds,rememberthatthisVIreadsthevariablesstartingatthememoryaddresspointedtobyInpVectinthefollowingorder:Primary
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NISoftMotionControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwiththeNISoftMotionController:
Thesecondaryresetpositionisignored.Whenyouresetaslaveposition,gearingisnotdisabled.
NoteNationalInstrumentsrecommendsthatyoudonotresetthepositionwhenanaxisismovingorgearingisenabledbecausedoingsomightcausetheaxistojumpand/orcauseafollowingerror.
SetOperationModeSetstheoperationmodeforanaxisorvectorspace.
DetailsRemarks
DeviceCompatibility
PositionMode(Absolute)selectsthetypeofpositionorvelocitymodeforanaxisorvectorspace.
Value Definition0 AbsolutePosition1 RelativePosition2 Velocity3 RelativetoCapture4 ModulusPosition5 AbsoluteContouring6 RelativeContouring
ThesemodesaredescribedintheUsingThisVIsection.BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.AxisorVectorSpaceistheaxisorvectorspacetoconfigure.errorin(noerror)describeserrorconditionsthatoccurbeforethisVI
UsingThisVI
TheSetOperationModeVIisusedbothduringinitializationandduringnormalmotioncontroloperationtoconfigurethemodeofoperationforalltrajectorycommandstotheaxisorvectorspacespecified.
Positionmodesareappliedtoallaxesinacoordinate(vector)space.Ifyoulaterwanttooperateanaxisindependentlyinadifferentmodefromtheotheraxes,callSetOperationModeagainonthataxis.
NoteAllaxesinacoordinate(vector)spacemusthavethesameoperationmode.IftheoperationmodesaredifferentoneachAxiswhenaStartMotionorBlendMotionVIisexecuted,anerrorisgenerated.
Theoperationmodemustbesetorchangedbeforeanyothertrajectoryparametersareloadedforthenextmove.Theoperationmodeaffectshowthetargetpositionandvelocityvaluesareinterpreted.Trajectoryparametersloadedafteramodechangeareinterpretedinthenewlyselectedmode.Trajectoryparametersloadedanytimebeforeamodechangedonotreflectthenewmode.
NoteChangingoperationmodeafterthetrajectoryparametersareloadedcanresultinimproperoperation.
Thefiveoperationmodesaredescribedinthefollowingsections:
AbsolutePosition
Inabsolutepositionmode,targetpositionsareinterpretedwithrespecttoanorigin,reference,orzeroposition.Theoriginistypicallysetatahomeswitch,endoftravellimitswitch,orencoderindexposition.Anabsolutepositionmoveusesthepreprogrammedvaluesofacceleration,deceleration,s-curve,andvelocitytocompleteatrajectoryprofilewithanendingpositionequaltotheloadedabsolutetargetposition.
Thelengthofanabsolutemovedependsupontheloadedpositionandthecurrentpositionwhenthemoveisstarted.Ifthetargetpositionisthesameas
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NI73xxControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwitha73xxmotioncontroller:
NI7330andNI7390controllersdonotsupportabsoluteorrelativecontouring.NI73xxcontrollersdonotsupporttheVelocityoptionofthePositionModeparameterforvectorspaces.
NISoftMotionControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwiththeNISoftMotionController:
TheNISoftMotionControllerdoesnotsupporttheModulusPositionoptionforPositionMode.
WaitforBlendCompleteWaitsuptothespecifiedperiodoftimeforablendtobecompletedonanaxis,vectorspace,groupofaxes,orgroupofvectorspaces.
Details
DeviceCompatibility
PollInterval(20ms)istheamountoftime,inmilliseconds,towaitbetweensuccessivequeriestothecontrollertodetermineiftheblendiscomplete.Timeout(10,000ms)istheamountoftime,inmilliseconds,towaitfortheblendtobecomecomplete.BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.AxisorVectorSpacecanselectanaxis(1through15),vectorspace(0x11through0x14),multipleaxes(AxisControl),ormultiplevectorspaces(VectorSpaceControl).Whensimultaneouslyactingonmultipleaxesorvectorspaces,theAxis/VSMapparameterindicateswhichaxesorvectorspacesareinvolved.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassesthe
UsingThisVI
ThisutilityVIisbuiltontopoftheCheckBlendCompleteStatusVI,andisprovidedforyourprogrammingconvenience.ThisVIcomparestheaxesorvectorspacesspecifiedintheAxisorVectorSpaceandAxis/VSMapinputparameterswiththeblendcompletestatusfortheappropriateaxesorvectorspaces.Itdoesthisrepeatedly,withthePollIntervaltimedeterminingthefrequencythatthecontrollerisqueried.Whentheblendiscomplete,thisVIreturnswithBlendCompletesettoTrue,otherwiseitwaitsfortheamountoftimespecifiedbytheTimeoutparameter.IftheVIwaitslongerthanthespecifiedtimeout,itreturnsNIMC_eventTimeoutErrorandBlendCompleteissettofalse.
Theoutputisasingletrue/falsevalueindicatingwhetherornotthespecifiedblendorblendsarecomplete.
ThisVIdoesnotcheckforfollowingerrorstatusoraxisoffstatus.Checkingforfaultsduringmovesisrecommended.Todothis,useReadperAxisStatus,whichreturnsfollowingerrorandaxisoffstatusinadditiontothemovecompletestatus.RefertotheNI-MotionHelpformoreinformationandexamplecode.
Formoreinformationaboutblendcompletestatus,refertotheReadBlendStatusVI.
NotetoLabVIEWRTusersIfthisVIisusedwithLabVIEWRTinatime-criticalprioritythread,theentirethreadisputtosleepuntilthenextmultipleofPollInterval.FormoreinformationrefertotheLabVIEWRTdocumentation
WaitforMoveCompleteWaitsuptothespecifiedperiodoftimeforamovetobecompletedonanaxis,vectorspace,groupofaxes,orgroupofvectorspaces.
Details
DeviceCompatibility
PollInterval(20ms)istheamountoftime,inmilliseconds,towaitbetweensuccessivequeriestothecontrollertodetermineiftheblendiscomplete.Timeout(10,000ms)istheamountoftime,inmilliseconds,towaitfortheblendtobecomecomplete.BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.AxisorVectorSpacecanselectanaxis(1through15),vectorspace(0x11through0x14),multipleaxes(AxisControl),ormultiplevectorspaces(VectorSpaceControl).Whensimultaneouslyactingonmultipleaxesorvectorspaces,theAxis/VSMapparameterindicateswhichaxesorvectorspacesareinvolved.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassesthe
UsingThisVI
ThisutilityVIisbuiltontopoftheCheckMoveCompleteStatusVI,andisprovidedforyourprogrammingconvenience.ThisVIcomparestheaxesorvectorspacesspecifiedintheAxisorVectorSpaceandAxis/VSMapinputparameterswiththemovecompletestatusfortheappropriateaxesorvectorspaces.Itdoesthisrepeatedly,withthePollIntervaltimedeterminingthefrequencythatthecontrollerisqueried.Whenthemoveiscomplete,thisVIreturnswithMoveCompletesettoTrue,otherwiseitwaitsfortheamountoftimespecifiedbytheTimeoutparameter.IftheVIwaitslongerthanthespecifiedtimeout,itreturnsNIMC_eventTimeoutErrorandMoveCompleteissettofalse.
Theoutputisasingletrue/falsevalueindicatingwhetherornotthespecifiedmoveormovesarecomplete.
ThisVIdoesnotcheckforfollowingerrorstatusoraxisoffstatus.Checkingforfaultsduringmovesisrecommended.Todothis,useReadperAxisStatus,whichreturnsfollowingerrorandaxisoffstatusinadditiontothemovecompletestatus.RefertotheNI-MotionHelpformoreinformationandexamplecode.
Formoreinformationaboutmovecompletestatus,refertotheReadTrajectoryStatusandConfigureMoveCompleteCriteriaVIs.
NotetoLabVIEWRTusersIfthisVIisusedwithLabVIEWRTinatime-criticalprioritythread,theentirethreadisputtosleepuntilthenextmultipleofPollInterval.FormoreinformationrefertotheLabVIEWRTdocumentation
AdvancedTrajectoryVIsAdvancedTrajectoryVIsareusefulinspecialapplicationsandshowcasesomeofNI-Motion'spowerandflexibility.
YoucanuseAdvancedTrajectoryVIstoacquiretime-sampledpositionandvelocitydataintoalargeonboardbufferandthenlaterreaditoutforanalysisanddisplay.TheseVIsimplementadigitaloscilloscopethatisusefulduringsystemsetup,PIDtuning,andgeneralmotionwithdataacquisitionsynchronization.
ClicktheiconsforVIdescriptions.
LoadVelocityinRPM LoadPositionModulusLoadAccel/DecelinRPS/sec LoadS-CurveTimeLoadFollowingError LoadVelocityOverrideReadFollowingError LoadBaseVelocityAcquireTrajectoryData LoadVelocityThresholdReadTrajectoryData LoadVelocityThresholdinRPMReadBlendStatus LoadRun/StopThresholdReadMoveCompleteStatus ReadDACReadTrajectoryStatus ReadDACLimitStatus
LoadBlendFactor LoadTorqueOffsetReadTargetPosition LoadTorqueLimitReadStepsGenerated
AcquireTrajectoryDataAcquirestime-sampledpositionandvelocitydataonmultipleaxes.
DeviceCompatibility
Timeperiod(3ms)isthetimeperiodbetweensamplesinms.Therangeisfrom3(default)to65,535ms.BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.UsetheerrorhandlerVIstolookupthemeaningofthiscodeanddisplaythecorrespondingerrormessage.sourceisastringthatindicatestheoriginoftheerror,ifany.Typically,sourceisthenameoftheVIinwhichtheerroroccurred.
UsingThisVI
TheAcquireTrajectoryDataVIinitiatestheautomaticacquisitionofpositionandvelocitydatafortheselectedaxes.Thedataisheldinanonboardfirst-in-first-out(FIFO)bufferuntillaterreadbackwiththeReadTrajectoryDataVI.Youcanselectwhichaxestoacquiredataforandprogramthetimeperiodbetweensamples.
TheAcquireandReadTrajectoryDataVIsareusedtoacquireandreadbacktime-sampledpositionandvelocitydataforanalysisanddisplay.TheseVIsimplementadigitaloscilloscopethatisusefulduringsystemsetup,PIDtuning,andgeneralmotionwithdataacquisitionsynchronization.
Afteritisstarted,thisdataacquisitionoperatesautonomouslyinthebackgroundasaseparatetask.MotioncontroloperatesnormallyandyoucanexecuteothermotionVIssimultaneously.Dependingupontheprogrammedtimeperiodandthetotalnumberofsamples,thisacquisitiontaskcanrunanywherefromafewmillisecondstotensofhours.
CautionWaitanappropriateamountoftimebeforeattemptingtoreadbackthetrajectorydata.
Becausehostcommunication,eventhandling,arcpointgeneration,contourpointdispensing,bufferedbreakpoints,andbufferedhigh-speedcaptureareahigherpriorityonthecontrollerthanacquiringtrajectorydata,youmaynoticeirregulartimespacingofsampleddatawhenhostcommunicationsoreventnotificationisheavy.Tominimizethechanceofirregulardata,limithostcommunicationtoaminimumwhileacquiringtrajectorydata.Ifyoustillnoticeirregulardata,increasethetimeperiod.
Example
Toacquire100samplesofdataonaxes1and2at10ms/sample,calltheAcquireTrajectoryDataVIwiththefollowingparameters:
AxisMapcorrespondstothefollowing
LoadAccel/DecelinRPS/secLoadsthemaximumaccelerationand/ordecelerationvalueforanaxisorvectorspaceinRPS/s.
DetailsRemarks
DeviceCompatibility
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.InpVectindicatesthesourceofthedataforthisVI.Availableinputvectorsincludeimmediate(0xFF),variable(0x01through0x78),orindirectvariable(0x81through0xF8).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroora
UsingThisVI
TheLoadAccel/DecelinRPS/secVIspecifiesthemaximumrateofaccelerationand/ordecelerationforindividualaxesorvectorspacesinrevolutions/s2.Whenexecutedonavectorspace,thevaluecontrolsthevectoracceleration(deceleration)alongthevectormovepath.ThisVIrequirespreviouslyloadedvaluesofeithercountsperrevolution(forstepperaxes)orstepsperrevolution(forservoaxes)tooperatecorrectly.
YoucanusethisVItoloadseparatelimitsforaccelerationanddecelerationortosetthembothtothesamevaluewithonecall.Theseparametersaredouble-bufferedsoyoucanloadthemontheflywithoutaffectingthemoveinprocess,andtheytakeeffectonthenextStartorBlendMotioncall.Aftertheyareloaded,theseparametersremainineffectforallsubsequentmotionprofilesuntilre-loadedbythisVI.Youdonotneedtoloadaccelerationbeforeeachmoveunlessyouwanttochangetheaccelerationand/ordecelerationvalue.
Accelerationdefineshowquicklytheaxisoraxescomeuptospeedandistypicallylimitedtoavoidexcessivestressonthemotor,mechanicalsystem,and/orload.Aseparate,slowerdecelerationisusefulinapplicationswheregentlycomingtoastopismostimportant.
TipUseLoadMoveConstraintsinsteadofthisVIformoremoveoptions.
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NI73xxControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwitha73xxmotioncontroller:
RPS/svaluesstoredinonboardvariablesareindouble-precisionIEEEformat(f64).ForinformationaboutthenumberofvariablesrequiredtoholdanRPS/svalue,refertoUsingInputsandReturnVectorswithOnboardVariables.NI-Motionfirmwareusesa16.16fixed-pointformatinternallytorepresentvelocityincounts/sampleperiodorsteps/sampleperiodandacceleration/decelerationincounts/sampleperiod2orsteps/sampleperiod2.IfyouchangecountsorstepsperrevolutionorchangetheupdaterateusingEnableAxes,youmustreloadthevelocityandacceleration/deceleration.Youalsocanloadaccelerationanddecelerationincounts/s2orsteps/s2bycallingtheLoadAcceleration/DecelerationVI.IfyouaredoingonboardprogrammingandareusinginputVectortogetthedatathisVIneeds,noticethatthisVIreadsthevariablesstartingatthememoryaddresspointedtobyinputVectorinthefollowingorder:accelerationType,RPSPS.AccelerationanddecelerationvaluesinRPS/sareconvertedtoaninternal16.16fixed-pointformatinunitsofcounts/sample2orsteps/sample2beforebeingusedbythetrajectorygenerator.YoucancalculatetheminimumaccelerationincrementinRPS/swiththefollowingformula:
RPS/s=Amin×( )2×
where:Aminis1/65,536counts/sample2orsteps/sample2,
LoadBaseVelocitySetsthebasevelocityusedbythetrajectorycontrolloopfortheaxisspecified.
Details
DeviceCompatibility
BaseVelocityisthebasevelocityforthestepperaxisinsteps/secondandisa16-bitdatawordintherangeof0through65,535.Thedefaultvalueis0.BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.Axisistheaxistocontrol.InpVectindicatesthesourceofthedataforthisVI.Availableinputvectorsincludeimmediate(0xFF),variable(0x01through0x78),orindirectvariable(0x81through0xF8).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,or
UsingThisVI
Basevelocityistheminimumsteprateusedbythetrajectorygeneratorduringaccelerationanddeceleration.Basevelocityisusefulwhenthesystemusesfull-steporhalf-stepmode.Basevelocityisnotnecessaryifthesystemusesmicrostepping.
IfthetargetvelocityloadedwiththeLoadVelocityVIislowerthanthebasevelocity,thebasevelocityisreducedtoequaltheloadedtargetvelocity.
NoteThisVIisvalidonlyonaxesconfiguredassteppers,soyoumustconfigureanaxisasastepperusingtheConfigureAxisResourcesVIbeforeexecutingthisVI.
Example
Ifthebasevelocityloadedis2,000steps/sandtheloadedvelocityis5000,theaxisstartsatthebasevelocityandacceleratestotheloadedvelocity.Theaxisthendeceleratestothebasevelocityandstops,asshowninthefollowingfigure.
LoadBlendFactorLoadstheblendfactorforanaxisorvectorspace.
Details
DeviceCompatibility
BlendFactoristheblendfactormodeand/ordwelltime.–1specifiesnormalblending(default),0specifiesastartafterthepreviousmoveisfullystopped,andvalues>0specifyadditionaldwelltimeinmilliseconds.BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.AxisorVectorSpaceistheaxisorvectorspacetocontrol.InpVectindicatesthesourceofthedataforthisVI.Availableinputvectorsincludeimmediate(0xFF),variable(0x01through0x78),orindirectvariable(0x81through0xF8).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.
UsingThisVI
TheLoadBlendFactorVIcontrolshowtheBlendMotionVIoperates.Blendingautomaticallystartsapendingmoveonanaxisorvectorspacewhenthemoveinprocesscompletes.Exactlywhenthependingmovestartsisdeterminedbytheloadedblendfactor.
Ablendfactorof–1causesthependingmovetostartwhentheexistingmovefinishesitsconstantvelocitysegmentandstartstodecelerate,asshowninthefollowingfigure.Thisblendsthetwomovestogetherattheoptimumblendpoint.
Ifthetwomovesareatthesamevelocity,inthesamedirection,andhavematchingaccelerationanddeceleration,theysuperimposeperfectlywithoutadiporincreaseinaxisvelocity.Vectorvelocitydipsbasedontheamountofdeflectionfromastraightline.
Foravectormove,ifalloftheaxescontinueinthesamedirection,thevectorvelocityremainsconstant.But,ifoneoftheaxeschangesdirection,thevectorvelocitydoesnotremainconstantduringthetransitionphase.
Ablendfactorofzero(0)causesthependingmovetostartwhentheexistingmovefullycompletesitsprofile.
Positiveblendfactorsallowforadwellattheendofthefirstmovebeforetheautomaticstartofthependingmove.Theblendfactordwellisprogrammedinmilliseconds.
ThemaximumvalueofthepositiveblendfactordependsupontheSamplePIDRatethatyousetintheEnableAxesVI,becausetheDSPdelaysthetrajectorygeneratorsbasedonPIDsampleperiods.Theformulausedtodeterminethemaximumpositiveblendfactorisasfollows:
LoadFollowingErrorLoadsthefollowingerrortrippoint.
DetailsRemarks
DeviceCompatibility
FollowingErroristhefollowingerrortrippointincounts.Ifthefollowingerrorexceedsthisvalue,theaxisisautomaticallykilled.Therangeis0to32,767withadefaultof32,767counts.Loadingzero(0)isaspecialcasethatdisablesthefollowingerrortripfunctionality.BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.Axisistheaxistocontrol.InpVectindicatesthesourceofthedataforthisVI.Availableinputvectorsincludeimmediate(0xFF),variable(0x01through0x78),orindirectvariable(0x81through0xF8).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.If
UsingThisVI
TheLoadFollowingErrorVIsetsthemaximumallowablefollowingerror.Followingerroristhedifferencebetweentheinstantaneouscommandedtrajectorypositionandthefeedbackposition.Iftheabsolutevalueofthisdifferenceexceedsthetrippoint,aninternalkillstopisissuedandtheaxisisdisabled.
Ifthisaxisispartofacoordinate(vector)space,allotheraxesarecommandedtodeceleratetoastopwhenoneaxistripsonfollowingerror.
ThisVIisasafetyfeatureusedtoprotectthemotionhardwareandassociatedsystemcomponentsfromdamagewhenthepositionerrorgetsexcessiveduetofriction,binding,oracompletelystalledmotor.Italsoprotectsthesystemincaseyouloadunobtainablevaluesforvelocityand/oracceleration.
Thisfeatureisavailableonallservoandclosed-loopstepperaxes.Ithasnoeffectonstepperaxesrunninginopen-loopmode.Youcancompletelydisablethefollowingerrorfeaturebyloadingazero(0)value.
CautionFollowingerrormustnotbedisabledunlesstheapplicationabsolutelyrequiresoperatingwithgreaterthan32,767countsoferror.
YoucanmonitorfollowingerrorstatuswiththeReadTrajectoryStatusorReadperAxisStatusVIs.AfollowingerrortripalwayssetstheMotorOffstatus.Inservosystems,youcanfurtherdiagnosethecauseofthetripbycheckingthetorquelimitstatuswiththeReadDACLimitStatusVI.
Ifanaxistripsonfollowingerror,thataxis,oranyaxesassociatedthroughacoordinatespace,areprohibitedfromstartingfromanonboardprogramuntilastartfromthehost,pauseoftheonboardprogram,orrunofanonboardprogram.
Ingeneral,afollowingerrortripisconsiderednormaloperationanddoesnotgenerateanerror.Thereareafewcaseswhereanunexpectedfollowingerrortripgeneratesamodalerror:duringFindReference,andwhileexecutinga
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NISoftMotionControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwiththeNISoftMotionController:
TheNISoftMotionControllerdoesnotsupportloadingzero(0)inFollowingErrortodisablethefollowingerror.FortheInpVectparameter,theNISoftMotionControllersupportsonlytheimmediatereturnvector(0XFF).
LoadMoveConstraintsLoadsmoveconstraintsinuserunits.
DetailsRemarks
DeviceCompatibility
DataisaclusterofvariablesthatcontainsthevaluesfortheselectedAttribute.
Integeris32-bitintegerdata.Doubleis64-bitfloatingpointdata.BooleanisBooleandata.
Attributeistheattributeyouwanttoload:
VelocityConstraint—SettheDoubleelementoftheDataclustertotheappropriatevelocitylimitinuserunits/second.AccelerationConstraint—SettheDoubleelementoftheDataclustertotheappropriateaccelerationlimitinuserunits/second2.DecelerationConstraint—SettheDoubleelementoftheDataclustertotheappropriatedecelerationlimitinuserunits/second2.AccelerationJerk—SettheDoubleelementoftheDataclustertotheappropriateaccelerationjerklimitinuserunits/second3.DecelerationJerk—SettheDoubleelementoftheDataclustertotheappropriatedecelerationjerklimitinuserunits/second3.
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorerusedtosendandreceivecommandsanddatatoorfroma
UsingThisVI
ThisVIloadsmoveconstraintsinuserunitsusingtheDoubleparameteroftheDatacluster.UseLoadCounts/StepsperRevolutiontosettheuserunitratio.
Example1
Ifyouload2,000counts/revusingtheLoadCounts/StepsperRevolutionVI,andyoucallLoadMoveConstraintswithVelocityConstraintsetto10.5,thevelocityloadedis10.5revolutions/secondor21,000counts/second.
Example2
IfyousetCounts(Steps)/Revto1intheLoadCounts/StepsperRevolutionVI,andyoucallLoadMoveConstraintswithVelocityConstraintsetto1.3,thevelocityloadedis1.3counts/second.
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NI73xxControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwitha73xxmotioncontroller:
73xxcontrollersdonotsupporttheAccelerationJerkandDecelerationJerkattributes.UseLoadVelocityandLoadAcceleration/Decelerationforfasterperformance.
LoadPositionModulusLoadsthepositionmodulusforanaxis.
Details
DeviceCompatibility
PositionModulus(0)isthepositionmodulusvalueincounts(servoaxes)orsteps(stepperaxes).Themodulusrangeisfrom0(default)to(231)–1.BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.Axisistheaxistocontrol.InpVectindicatesthesourceofthedataforthisVI.Availableinputvectorsincludeimmediate(0xFF),variable(0x01through0x78),orindirectvariable(0x81through0xF8).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,
UsingThisVI
TheLoadPositionModulusVIsetsthemodulususedwhentheaxisisoperatinginModulusPositionmode.Ithasnoeffectwhentheaxisisoperatinginothermodes.Whenatargetpositionisloaded,itisinterpretedwithintheboundariesofamodulusrange.
RefertotheSetOperationModeVIforacompletedescriptionoftheModulusPositionmode.
LoadRun/StopThresholdSetsthevelocityRun/StopThreshold,whichaffectstherun/stopstatusreturnedbyReadTrajectoryStatus.
Details
DeviceCompatibility
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.Run/StopThresholdistheRun/Stopthresholdvelocityincounts/sampleperiodforservoaxesorsteps/sampleperiodforopen-loopandclosed-loopstepperaxes.Therangeforthisparameteris1(default)to32,767countsorsteps/sampleperiod.Thisparametersetsthenumberofcounts/stepsanaxismustmovetobeconsideredrunning.Axisistheaxistoconfigure.InpVectindicatesthesourceofthedataforthisVI.Availableinputvectorsincludeimmediate(0xFF),variable(0x01through0x78),orindirectvariable(0x81through0xF8).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowing
UsingThisVI
ThisVIsetsthevelocitythresholdabovewhichanaxisisconsideredrunning.TheRun/StopThresholdparameterhastimeunitsofupdatesampleperiodsandisaffectedbytheupdateratesetintheEnableAxesVI.
Ifthevelocityofanaxisisabovethestep/countpersampleperiodspecifiedinthisVI,therun/stopstatusfromReadTrajectoryStatusreturnsTRUE.Ifitisbelowthethreshold,therun/stopstatusreturnsFALSE.
LoadS-CurveTimeLoadsthes-curvetimeforanaxisorvectorspace.
DetailsRemarks
DeviceCompatibility
SCurveTime(1)isthetimeinupdatesampleperiodsoverwhichtheaccelerationprofileissmoothedasittransitionsfromzerototheprogrammedvalueandbacktozero.Thes-curverangeisfrom1to32,767withadefaultof1sampleperiod.BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.AxisorVectorSpaceistheaxisorvectorspacetocontrol.InpVectindicatesthesourceofthedataforthisVI.Availableinputvectorsincludeimmediate(0xFF),variable(0x01through0x78),orindirectvariable(0x81through0xF8).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,or
UsingThisVI
TheLoadS-CurveTimeVIsmoothestheaccelerationanddecelerationportionsofamotionprofile,resultinginlessabrupttransitionsfromstartmotiontoacceleration,accelerationtoconstantvelocity,constantvelocitytodeceleration,anddecelerationtostop.Usings-curveaccelerationlimitsthejerkinamotioncontrolsystem.
Officially,jerkisdefinedasthederivativeofacceleration(changeofaccelerationperunittime)andismeasuredinunitsofcounts(steps)/s3.ThisVI,however,allowsyoutoloads-curvetimeinupdatesampleperiodsratherthanhavetodealwiththeobscureunitsofjerk.
Withthedefaults-curvetimeofone(1)sampleperiod,thereisalmostnoeffectonthemotionprofile,andthestandardtrapezoidaltrajectoryisexecuted.Ass-curvetimeincreases,thesmoothingeffectontheaccelerationanddecelerationportionsofthemotionprofileincrease,asshowninthefollowingfigure.Largevaluesofs-curvetimecanoverridetheprogrammedvaluesofaccelerationanddecelerationbysufficientlysmoothingtheprofilesuchthattheaccelerationanddecelerationslopesareneverreached.
NoteAlarges-curvevaluemakesthetimetoacceleratetothecommandedvelocitylonger.Therefore,thetimeittakestoreachthetargetpositionisalsolonger.Ifthes-curvevalueistoolarge,thevalueisignoredandfullaccelerationisused.Thishappenswhentheaccelerationanddecelerationbecometoolongtoperformsmoothly.
Youcanloads-curvetimetoindividualaxesortoavectorspaceforsmoothingallaxesinthevectorspace.Whensenttoavectorspace,thes-curvetimeisbroadcasttoallaxesinthevectorspacetochangetheper-axiss-curvetimes.Ifyoulaterwanttooperateanaxisindependentlywithadifferents-curvetime,youmustexecutetheLoadS-CurveTimeVIagainforthataxis.
NoteAllaxesinavectorspacemusthavethesames-curvetimeforbest
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NISoftMotionControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwiththeNISoftMotionController:
WhenyouusethisVIwiththeNISoftMotionController,SCurveTime(1)isthesmoothingtimeinthehostloopperiod.NationalInstrumentssuggestsyouusetheLoadMoveConstraintsVIwiththeNISoftMotionControllerinsteadofusingthisVI.
LoadTorqueLimitLoadsprimaryandsecondaryDACtorquelimitsforanaxis.
Details
DeviceCompatibility
Secondary(–)LimitistheoptionalsecondaryDACnegativetorque(orvelocity)limit.Therangeis–32,768to+32,767(–10Vto+10V)withadefaultvalueof–32,768(–10V).
NoteThepositivelimitcannotbelessthanthenegativelimit.Secondary(+)LimitistheoptionalsecondaryDACpositivetorque(orvelocity)limit.Therangeis–32,768to+32,767(–10Vto+10V)withadefaultvalueof32,767(+10V).BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.Axisistheaxistocontrol.InpVectcontainstheprimarypositive,primarynegative,secondarypositive,andsecondarynegativeparametersthatarethesourceofdataforthisVI.
Availableinputvectorsincludeimmediate(0xFF),variable(0x01through0x78),orindirectvariable(0x81through0xF8).RefertoInputandReturn
UsingThisVI
TheLoadTorqueLimitVIallowsyoutolimittheoutputrangeoftheDACoutput(s)ontheselectedservoaxis.ThisVIhasnoeffectonstepperaxesorindependentDACoutputsthatarenotmappedtoanaxis.
BylimitingtheoutputrangeofaDAC,itispossibletocontrolthemaximumtorque(whenconnectedtoatorqueblockservoamplifier)orvelocity(whenconnectedtoavelocityblockservoamplifier).ThisVIisalsohelpfulwheninterfacingtoamplifiersthatdonotsupportthestandard±10Vcommandrange.
PrimaryandsecondaryDACscanhavedifferentlimits,andthepositiveandnegativelimitscanbebothpositiveorbothnegativetolimittheDACoutputtoaunipolarrange.TheonlyrestrictionisthatapositiveDAClimitcannotbelessthanthenegativeDAClimit.
YoualsocansetatorqueoffsetontheprimaryandsecondaryDACoutputs.RefertotheLoadTorqueOffsetVIformoreinformation.
Example
CallingtheLoadTorqueLimitVIwiththefollowingparameterslimitstheoutputrangesoftheprimaryandsecondaryDACsmappedtotheaxis,asshowninthefollowingfigure:
PrimaryPositiveLimit=16,383PrimaryNegativeLimit=–16,384SecondaryPositiveLimit=8,191SecondaryNegativeLimit=–32,768
TheresultofthisVIcallistolimittheprimaryDACtoonlyhalfitsrangeineitherdirection,or±5V.ThesecondaryDACcanonlytraveloveraquarterofitspositiverangebuthasitsfullnegativerange.
LoadTorqueOffsetLoadsprimaryandsecondaryDACtorqueoffsetsforanaxis.
Details
DeviceCompatibility
SecondaryOffset(0)isthesecondaryDACtorque(orvelocity)offset.Theoffsetrangeis–32,768to+32,767(–10Vto+10V)withadefaultvalueof0(0V).
NoteTheoffsetvaluemustbewithintherangelimitssetbytheLoadTorqueLimitVI.
PrimaryOffset(0)istheprimaryDACtorque(orvelocity)offset.Theoffsetrangeis–32,768to+32,767(–10Vto+10V)withadefaultvalueof0(0V).BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.Axisistheaxistocontrol.InpVectcontainstheprimaryandsecondaryparametersthatarethesourceofdataforthisVI.
Availableinputvectorsincludeimmediate(0xFF),variable(0x01through0x78),orindirectvariable(0x81through0xF8).RefertoInputandReturnVectorsformoredetailedinformation.
UsingThisVI
TheLoadTorqueOffsetVIloadsoffsetvaluesfortheDACsmappedtotheselectedservoaxis.ThisVIhasnoeffectonstepperaxesorindependentDACoutputsthatarenotmappedtoanaxis.WhenaDACisconnectedtoavelocityblockservoamplifier,thetorqueoffsetfunctionsasavelocityoffset.
Atorque(orvelocity)offsetshiftstheDACoutput(s)bytheprogrammedoffsetvaluewithoutrequiringanyactionfromthePIDloop.Inaservosystem,thiscanbeusedtoovercomeamplifierinputoffsets,systemimbalances,ortheeffectsofoutsideforcessuchasgravity.DifferenttorqueoffsetscanbeloadedfortheprimaryandsecondaryDAC.
NoteWhenanAxisiskilled,itsDACoutputsarezeroedregardlessofthetorqueoffsetloaded.
DACoffsetscanbeusedinconjunctionwithDACrangelimitstointerfacetoservoamplifierswithunipolarinputranges(forexample,0to5Vor0to10V).
Example
CallingtheLoadTorqueOffsetVIwithPrimaryOffset=4,096andSecondaryOffset=0shiftstheoutputrangesoftheprimaryDACmappedtotheaxisasshowninthefollowingfigure:
TheresultofthisVIcallistolimittheprimaryDACtoarangeof–8.75Vto+10Vwithanoffsetornullvalueof+1.25V.ThisisbecauseevenwhenthePIDloopiscommandingfullnegativetorque,thetorqueoffsetisaddedandtheresultingoutputis–8.75V.Inthepositivedirection,theDACcannotgoabove+10Vnomatterwhattheoffsetis.
TheVIcallleavesthesecondaryDACoffsetatitsdefaultvalueofzero(0).ThisexampleassumesthefulltorquerangeisavailableandnotlimitedbytheLoadTorqueLimitVI.
LoadVelocityinRPMLoadsvelocityforanaxisorvectorspaceinRPM.
DetailsRemarks
DeviceCompatibility
Velocity(500)isthedoubleprecisionfloatingpointvelocityvalueinRPM.TheVelocityrangedependsuponthemotorcountsorstepsperrevolutionandthetrajectoryupdaterate.BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.AxisorVectorSpaceistheaxisorvectorspacetocontrol.InpVectindicatesthesourceofthedataforthisVI.Availableinputvectorsincludeimmediate(0xFF),variable(0x01through0x78),orindirectvariable(0x81through0xF8).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.If
UsingThisVI
TheLoadVelocityinRPMVIspecifiesthemaximumtrajectoryvelocityforindividualaxesorvectorspaces.Whenexecutedonavectorspace,thevaluecontrolsthevectorvelocityalongthevectormovepath.Forvelocitycontrolapplications,thesignoftheloadedvelocityspecifiesthemovedirection.ThisVIrequirespreviouslyloadedvaluesofeithercountsperrevolution(forservoaxes)orstepsperrevolution(forstepperaxes)tooperatecorrectly.
RPMisdouble-buffered,soyoucanloaditontheflywithoutaffectingthemoveinprocess,andittakeseffectonthenextStartorBlendMotioncall.Afteritisloaded,thisparameterremainsineffectforallsubsequentmotionprofilesuntilre-loadedbythisVI.Youdonotneedtoloadvelocitybeforeeachmoveunlessyouwanttochangethevelocity.
NoteThevelocityloadedwiththisVIisthemaximummovevelocity.ActualvelocityattainableisdeterminedbymanyfactorsincludingPIDtuning,lengthofmove,accelerationanddecelerationvalues,andphysicalconstraintsoftheamplifier/motor/mechanicalsystem.
Youalsocanloadvelocityincounts/sorsteps/sbycallingtheLoadVelocityVI.TipUseLoadMoveConstraintsinsteadofthisVIformoremoveoptions.NoteRefertoVIExecutionTimesforbenchmarktiminginformationaboutyourcontroller.
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NI73xxControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwitha73xxmotioncontroller:
For73xxmotioncontrollers,RPMvaluesstoredinonboardvariablesareindouble-precisionIEEEformat(f64).ForinformationaboutthenumberofvariablesrequiredtoholdanRPMvalue,refertoUsingInputsandReturnVectorswithOnboardVariables.
NoteNI-Motionfirmwareusesa16.16fixed-pointformatinternallytorepresentvelocityincounts/sampleperiodorsteps/sampleperiodandacceleration/decelerationincounts/sampleperiod2orsteps/sampleperiod2.IfyouchangecountsorstepsperrevolutionorchangetheupdaterateusingEnableAxes,youmustreloadthevelocityandacceleration/deceleration.
VelocityvaluesinRPMareconvertedtoaninternal16.16fixed-pointformatinunitsofcounts(steps)persampleperiod(updateperiod)beforebeingusedbythetrajectorygenerator.NI-Motioncancontrolvelocityto1/65,536ofacountorsteppersample.YoucancalculatethisminimumvelocityincrementinRPMwiththefollowingformula:
minimumRPM=Vmin×( )×60×( )
where:Vminis1/65,536count/sampleorstep/sample,Tsisthesampleperiodinsecondspersample,60isthenumberofsecondsinaminute,andRisthecounts/stepsperrevolution.
Foratypicalservoaxiswith2,000countsperrevolutionoperatingatthe250µsupdaterate,theminimumRPMincrementis:
LoadVelocityOverrideLoadsaninstantaneousvelocityoverrideforanaxisorvectorspace.
DetailsRemarks
DeviceCompatibility
OverridePercentage(100%)isasingleprecisionfloatingpointvaluefrom0to150%.Thisvaluedirectlyscalestheprogrammedvelocity.Thedefaultvalueis100%(noeffect).BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.AxisorVectorSpaceistheaxisorvectorspacetocontrol.InpVectindicatesthesourceofthedataforthisVI.Availableinputvectorsincludeimmediate(0xFF),variable(0x01through0x78),orindirectvariable(0x81through0xF8).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.If
UsingThisVI
TheLoadVelocityOverrideVIscalestheoperatingvelocityonanaxisorvectorspacefrom0to150%.Velocityoverrideisnotdouble-buffered.TheVItakeseffectimmediatelyanddoesnotrequireaStartorBlendMotionVIexecutiontochangetheoperatingvelocity.Allvelocitychangesusetheloadedvaluesofacceleration,deceleration,ands-curvetosmoothlytransitionthevelocitytoitsnewvalue.
Velocityoverridescalesvelocityinlinearinterpolationaswellasincircular,helical,andsphericalarcs.
NoteVelocityoverrideisnotvalidforcontouredmoves.
Youcanloadvelocityoverridetoindividualaxesortoavectorspaceforcoordinatedvelocityscaling.Whensenttoavectorspace,thevelocityoverrideisbroadcasttoallaxesinthevectorspacetochangetheper-axisoverrides.Ifyoulaterwanttooperateanaxisindependentlywithadifferentvelocityoverride,youmustexecutetheLoadVelocityOverrideVIagainforthataxis.Notethatthisalsoworkswithgearing.Inadditiontofollowingthepositionofthemasteraxis,theslavefollowsthevelocityofthemasteraxis.
Afteritisloaded,velocityoverrideremainsineffectuntilchangedbyanothercalltothisVI.Allsubsequentmovesareatvelocitiesscaledbythemostrecentoverridepercentage.Atpower-upreset,velocityoverrideisalwaysresetto100%.
Velocityoverrideiscommonlyusedinmachinetoolandotherapplicationstoreducethespeedofaprogrammedmotionsequenceandcanbeusedtoimplementafeedholdbysettingthevaluetozero(0).Youcandirectlyuseascaledvaluefromananaloginputasthevelocityoverridevalue.
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NI73xxControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwitha73xxmotioncontroller:
For73xxcontrollers,theresolutionofthisVIisapproximately0.4%.Theconversionfromfloating-pointtofixed-pointisperformedonthehostcomputer,notonthemotioncontroller.Toloadvelocityoverridefromanonboardvariable,youmustusetheintegerrepresentationof0to384.Allaxesinavectorspacemusthavethesamevelocityoverride.Ifaxeshavedifferentvelocityoverrides,thevectormovecannotfunctionasexpected.Thismodeislegalanddoesnotgenerateanerror,butitcausestheaxestofinishtheirmovesatdifferenttimes.
NISoftMotionControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwiththeNISoftMotionController:
Ifvelocityoverrideisloadedonanaxis,itisappliedonlyduringsingle-axismoves.Ifthevelocityoverrideisloadedonavectorspace,itdoesnotoverwritethevaluesfortheaxesthatareinthevectorspace.Inthiscase,thevelocityoverrideisappliedonlyduringvectorspacemoves.TherangefortheOverridePercentageisthefull64-bitrange,andisnotlimitedto150%fortheNISoftMotionController.
LoadVelocityThresholdLoadsavelocitythresholdforanaxis.
DetailsRemarks
DeviceCompatibility
VelocityThreshold(100,000)isthevelocitythresholdincounts/s(servoaxes)orsteps/s(stepperaxes).Forservoaxes,thethresholdrangeis1to16,000,000counts/s.Forstepperaxes,itis1to1,500,000steps/s.Thefactorydefaultvalueforthresholdisthemaximum,sothefeatureiseffectivelydisableduntilathresholdisloaded.BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.Axisistheaxistocontrol.InpVectindicatesthesourceofthedataforthisVI.Availableinputvectorsincludeimmediate(0xFF),variable(0x01through0x78),orindirectvariable(0x81through0xF8).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,or
UsingThisVI
TheLoadVelocityThresholdVIestablishesavelocitythresholdforthespecifiedaxis,whichcanthenbemonitoredwiththeReadTrajectoryStatusVI.ThevelocitythresholdstatusisTruewhentheabsolutevalueoffilteredaxisvelocityisabovethethresholdandFalsewhenthevelocitydropsbelowthethreshold.
Velocitythresholdisastatusanddoesnothavetobeenabledordisabled.Loadingamaximumvalueeffectivelydisablesthefeaturebecausethestatuswillalwaysbeoff.IncreasingthevelocityfiltertimeconstantwiththeConfigureVelocityFilterVIreducesquantizationnoiseinthethresholdstatusbutattheexpenseofincreasingthresholdstatuslatency.
Velocitythresholdistypicallyusedtomonitortheaccelerationanddecelerationtrajectoryperiodstoseewhenorifanaxisisuptospeed.YoucanthenchangePIDtuningorotherparametersasafunctionofvelocity.
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NISoftMotionControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwiththeNISoftMotionController:
UseLoadCounts/StepsperRevolutiontosetCounts(Steps)/Revvalueto1.Otherwise,NI-Motionreturnsanerror.
LoadVelocityThresholdinRPMLoadsavelocitythresholdforanaxisinRPM.
Details
DeviceCompatibility
VelocityThreshold(5000)isthedouble-precisionfloatingpointvelocitythresholdvalueinRPM.TheRPMrangedependsuponthemotorcountsorstepsperrevolutionandthetrajectoryupdaterate,andisalwaysapositivenumber.BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.Axisistheaxistocontrol.InpVectindicatesthesourceofthedataforthisVI.Availableinputvectorsincludeimmediate(0xFF),variable(0x01through0x78),orindirectvariable(0x81through0xF8).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,or
UsingThisVI
TheLoadVelocityThresholdVIestablishesavelocitythresholdinRPMforthespecifiedaxiswhichcanthenbemonitoredwiththeReadTrajectoryStatusVI.ThevelocitythresholdstatusisTruewhentheabsolutevalueoffilteredaxisvelocityisabovethethresholdandFalsewhenthevelocitydropsbelowthethreshold.
Velocitythresholdisastatusanddoesnothavetobeenabledordisabled.Loadingamaximumvalueeffectivelydisablesthefeaturebecausethestatuswillalwaysbeoff.IncreasingthevelocityfiltertimeconstantwiththeLoadVelocityFilterParameterVIreducesquantizationnoiseinthethresholdstatusbutattheexpenseofincreasingthresholdstatuslatency.
Velocitythresholdistypicallyusedtomonitortheaccelerationanddecelerationtrajectoryperiodstoseewhenorifanaxisisuptospeed.YoucanthenchangePIDtuningorotherparametersasafunctionofvelocity.
ReadBlendStatusReadstheBlendCompletestatusforallaxesorvectorspaces.
Details
DeviceCompatibility
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.AxisorVectorSpaceselectsaxis,axiscontrol,vectorspace,orvectorspacecontrolformovecomplete,oraxisoraxiscontrolforallothertypes.RetVectindicatesthedestinationforthereturndatageneratedbythisVI.Availablereturnvectorsincludereturndatatothehost(0xFF),returndatatoavariable(0x01through0x78),returndatatoanindirectvariable(0x81through0xF8),anddonotreturndata(0).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroora
UsingThisVI
Blendingsmoothlycombinestwomovesegmentsonanaxis,axes,orvectorspace(s).Whencontinuouslyblendingmovesegmentsintoeachother,itisnecessarytowaituntiltheblendiscompletebetweentheprevioustwomovesbeforeyouloadthetrajectoryparametersforthenextmovetoblend.
ThestatusinformationreturnedbytheReadBlendStatusVIindicatesthatthepreviousblendiscompleteandtheaxis,axes,orvectorspace(s)arereadytoreceivethenextblendmovetrajectorydata.
NoteAttemptingtoexecuteaBlendMotionVIbeforethepreviousblendiscompleteontheaxesinvolvedgeneratesamodalerror.RefertoErrorsandErrorHandlingforinformationabouterrorsanderrorhandling.
Example
Whileblendinga2Dvectorstraight-linemove,youcalltheReadBlendStatusVIwithAxisorVectorSpace=VectorSpaceControltoselectvectorspacestatus.Iftheblendonvectorspace1isstillpending,thisVIreturnsaBlendStatus,whichcorrespondstothefollowingbitmap.
Axis/VS1 Axis/VS2 Axis/VS3 Axis/VS4 Axis5 Axis6 Axis7 Axis8False True True False False False False False
Theblendiscomplete(1)onvectorspaces2and3(ortheydonotexist),buttheblendisstillpending(0)onvectorspace1.
Foryourprogrammingconvenience,twoutilityVIs—CheckBlendCompleteStatusandWaitforBlendComplete—areprovided,whichallowyoutospecifyanaxis,vectorspace,groupofaxes,orgroupofvectorspaces,andfindoutifablendiscomplete,orwaituntilablendiscomplete.TheseVIsreturnasimpletrue/falsevalueindicatingwhetherornotablendiscomplete.
ReadDACReadsthecommandedDACoutputvalueforanaxis.
Details
DeviceCompatibility
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.AxisorDACistheaxisorDACtoread.RetnVectindicatesthedestinationforthereturndatageneratedbythisVI.Availablereturnvectorsincludereturndatatothehost(0xFF),toavariable(0x01through0x78),toanindirectvariable(0x81through0xF8),anddonotreturndata(0).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.UsetheerrorhandlerVIstolookupthemeaningof
UsingThisVI
TheReadDACVIreturnsthevalueofthespecifiedDACoutput.Whensenttoanaxis,thisVIreturnsthevalueoftheprimaryDACmappedtothataxis.Thesigned16-bitvaluereturnedcorrespondstothe±10VfullscalerangeoftheDAC.
ThisVIisusedtomonitortheoutputcommandfromthePIDloop.WhentheDACoutputisconnectedtoatorqueblockservoamplifier,youcanusethisvaluetocalculatemotortorqueortomonitortheaccelerationanddecelerationportionsofatrajectorytoseehowclosethecontrolloopistosaturatingatitsmaximumtorquelimits.
WhentheDACoutputisconnectedtoavelocityblockservoamplifier,theDACvaluereadisadirectrepresentationoftheinstantaneouscommandedvelocity.
ReadDACLimitStatusReadsthestatusoftheDAClimits.
Details
DeviceCompatibility
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.RetVectcontainsthereverselimitsandforwardlimits,whicharereturnedinoneonboardvariable:0000000RRRRRRRR00000000FFFFFFFF0.
Availablereturnvectorsincludereturndatatothehost(0xFF),returndatatoavariable(0x01through0x78),returndatatoanindirectvariable(0x81through0xF8),anddonotreturndata(0).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.
UsingThisVI
TheReadDACLimitStatusVIreturnsthepositiveandnegativetorquelimitstatusoftheDACoutput.IndependentDACsthatarenotmappedtoaxesdonothavetorquelimits,sothoseDACswillalwaysreturnFalse.
ADACtorquelimitstatusisTrue(1)whentheDACoutputissaturatedatthecorrespondinglimit.Thisinformationtellsyouthatthemotorisoperatingatitsmaximumtorque,probablyduetoanexcessivelyhighvalueofaccelerationordeceleration.Italsocanindicateexcessivefrictionontheaxis,acompletelystalledmotor,orsomeothersystemfault.
Whenanaxisisactive(notinthekilled,motoroffstate),thisVIreturnstheinstantaneousstateofthetorquelimitcircuits.Iftheaxistripsoutonfollowingerror(atypicaloccurrencewhenoperatingatthetorquelimits),theDAClimitstatusislatchedsoyoucantellwhichlimit,positiveornegative,causedthefollowingerrortrip.ThestatusremainslatcheduntiltheaxisisactivatedagainbyaStart,Stop,orBlendMotionVI.
ReadFollowingErrorReadstheinstantaneousfollowingerrorforanaxisorvectorspace.
Details
DeviceCompatibility
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.AxisorVectorSpaceistheaxisorvectorspacetoread.RetnVectindicatesthedestinationforthereturndatageneratedbythisVI.Availablereturnvectorsincludereturndatatothehost(0xFF),toavariable(0x01through0x78),toanindirectvariable(0x81through0xF8),anddonotreturndata(0).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,
UsingThisVI
TheReadFollowingErrorVIreturnstheinstantaneousfollowingerrorfortheaxisorvectorspacespecified.Forvectorspaces,followingerroristheroot-mean-squareofthefollowingerrorsfortheindividualaxesthatmakeupthevectorspace.
ReadMoveCompleteStatusReadsthemovecompletestatus(MCS)register.
DetailsRemarks
DeviceCompatibility
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.UsetheerrorhandlerVIstolookupthemeaningofthiscodeanddisplaythecorrespondingerrormessage.sourceisastringthatindicatestheoriginoftheerror,ifany.Typically,sourceisthenameoftheVIinwhichtheerroroccurred.
MoveCompleteStatusisabitmapofMCSforuptoeightaxes.ThebitmapalsoincludesthestateofthethreeStatusbits:
UsingThisVI
ThissectionincludesmoredetailedinformationaboutusingthisVI.
NoteRefertoVIExecutionTimesforbenchmarktiminginformationaboutyourcontroller.
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NI73xxControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwitha73xxmotioncontroller:
ThisVIperformsadirectreadoftheMoveCompleteStatus(MCS)registeronthe73xxcontroller.BecausearegisterreadisvirtuallyinstantaneousanddoesnotaffectcommunicationprocessingorotherNI-Motionoperations,youcancallthisVIrepeatedlytogetthemostup-to-datestatusfortheaxes.MoveCompleteStatusisconfigurableindividuallyforeachaxiswiththeConfigureMoveCompleteCriteriaVI.ThecriteriaforconsideringmotiontobecompleteincludeProfileComplete,Run/Stop,In-Position,Settlingtimedelay,andsoon.
NoteReadingtheMCSregisterimmediatelyaftercallingtheStartMotionVImightnotreturnthestatusyouexpected.TheStartMotioncanstillbebufferedinthecommunicationsFIFOwhentheinstantaneousreadoftheMCSoccurs.
ThisVIalsoreturnsthestateoftheUserStatusbits.Youcansetandresetthesethreebitsduringonboardprogramexecutionasgeneral-purposeflagstothehostcomputer.RefertotheSetUserStatusMOMOVIformoreinformation.
NoteWhenthe73xxmotioncontrollerisinthePower-Upstate,theMCSregistercontainsapower-upcodethatdescribeswhythecontrollerisinthePower-Upstate.Foralistofthesepower-upcodes,refertotheClearPowerUpStatusVI.
NISoftMotionControllerConsiderations
Thefollowinglistincludesconsiderationsyoumustmakewhenyouareusing
ReadStepsGeneratedReadsthenumberofstepsgeneratedbyastepperoutput.
Details
DeviceCompatibility
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.AxisorStepperOutputistheaxisorstepperoutputtoread.RetVectindicatesthedestinationforthereturndatageneratedbythisVI.Availablereturnvectorsincludereturndatatothehost(0xFF),returndatatoavariable(0x01through0x78),returndatatoanindirectvariable(0x81through0xF8),anddonotreturndata(0).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,
UsingThisVI
TheReadStepsGeneratedVIreturnsanumberbasedonstepsgeneratedbyastepperaxisorstepperoutputresource.Foropen-loopstepperaxes,thisVIreturnsexactlythesamevalueastheReadPositionVI.
Forclosed-loopstepperaxes,thisVIreturnstheactualnumberofstepsgeneratedwhiletheReadPositionVIreturnsthefeedbackpositionconvertedfromcountstosteps.Thenumberofstepsgeneratedincludesextrastepsaddedduringanypull-inmoverequiredtoreachthetargetposition.
ToresetthevaluereturnedbythisVI,useResetPosition.ResetPositionsetsthestepsparametertotheresetpositionvalue.
Closed-LoopStepperExample
Supposeyouexecuteamovefromposition0toposition100,and10additionalstepsaregeneratedforthepull-inmove.ReadPositionreturns100,butReadStepsGeneratedreturns110.Ifyouexecuteanothermovetoposition50,ReadPositionreturns50,andReadStepsGeneratedreturns60.
ReadTargetPositionReadsthedestinationpositionofthecurrentmotiontrajectory.
DetailsRemarks
DeviceCompatibility
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.Axisistheaxistoread.RetnVectindicatesthedestinationforthereturndatageneratedbythisVI.Availablereturnvectorsincludereturndatatothehost(0xFF),toavariable(0x01through0x78),toanindirectvariable(0x81through0xF8),anddonotreturndata(0).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,
UsingThisVI
TheReadTargetPositionVIreturnsthedestinationpositionofthemotiontrajectorycurrentlyinprocess.Iftheaxisisstopped,itreturnsthetargetpositionofthelasttrajectorycompleted.
ThisVIdiffersfromtheReadPositionVIinthatitreturnsthecommandedtarget(destination)positionratherthantheactualfeedbackposition.
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NI73xxControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwitha73xxmotioncontroller:
LoadinganewtargetpositionwithLoadTargetPositiondoesnotaffectthevaluereaduntilastartmotionoccurs.WhencallingBlendMotion,thevaluereaddoesnotreflectthelasttargetpositionloadeduntilaftertheblendoccurs.
NISoftMotionControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwiththeNISoftMotionController:
TheNISoftMotionControllerreturnsthetargetpositionloadedregardlessofwhethertheStartMotionVIhasbeencalled.TheNISoftMotionControllerreturnsthetargetpositionofindividualaxes,butdoesnotreturnthetargetpositionloadedbytheLoadVectorSpacePositionVI,eveniftheaxisisconfiguredaspartofthevectorspace.
TheNISoftMotionControllerdoesnotsupportreadingthetargetpositionofavectorspace.
ReadTrajectoryDataReadsasampleofacquireddatafromthesamplesbuffer.
Details
DeviceCompatibility
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.RetVectcontainspositionandvelocity.Positionisreturnedinonboardvariablenincounts(steps),andvelocityisreturnedinonboardvariablen+1incounts/s(steps/s).
Availablereturnvectorsincludereturndatatothehost(0xFF),returndatatoavariable(0x01through0x78),returndatatoanindirectvariable(0x81through0xF8),anddonotreturndata(0).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.
UsingThisVI
TheReadTrajectoryDataVIisusedtoreadbackasinglesampleofacquireddatafromtheonboardsamplebuffer.Thenumberofsamples,thetimebetweensamplesandthesizeofeachsampleissetwhenyouexecutetheAcquireTrajectoryDataVI.Thesamplebufferoperatesfirst-in-first-out(FIFO),somultiplecallstothisVIreturnsamplesintheircorrecttimesequence.
Whileitispossibletoreadthesamplebufferwhilesamplesarestillbeingacquired,youmustwaitenoughtimebetweencallstotheReadTrajectoryDataVItoavoidemptyingthebuffer.
NoteAttemptingtoreadanemptysamplebuffergeneratesanerror.RefertoErrorsandErrorHandlingforinformationabouterrorsanderrorhandling.
TheAcquireandReadTrajectoryDataVIsareusedtoacquireandreadbacktime-sampledpositionandvelocitydataforanalysisanddisplay.TheseVIsimplementadigitaloscilloscopethatisusefulduringsystemsetup,PIDtuning,andgeneralmotionwithdataacquisitionsynchronization.
Example
TheAcquireTrajectoryDataVIisexecutedwithaxes1,2,and4selected.EachcalltotheReadTrajectoryDataVIreturnsonesamplewithanarraysizeofsixandthefollowingdatainthearray:
SampleData[]={Axis1position,Axis1velocity,
Axis2position,Axis2velocity
Axis4position,Axis4velocity}
ReadTrajectoryStatusReadstheselectedmotiontrajectorystatusofallaxesorvectorspaces.
Details
DeviceCompatibility
StatusTypeistheselectorforthetypeoftrajectorystatustoread.
Value Definition0 Run/Stop1 MotorOff2 VelocityThreshold3 MoveCompleteBoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.AxisorVectorSpaceselectsaxis,axiscontrol,vectorspace,orvectorspacecontrolformovecomplete,oraxisoraxiscontrolforallothertypes.RetVectindicatesthedestinationforthereturndatageneratedbythisVI.Availablereturnvectorsincludereturndatatothehost(0xFF),returndatatoavariable(0x01through0x78),returndatatoanindirectvariable(0x81through0xF8),anddonotreturndata(0).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVI
UsingThisVI
TheReadTrajectoryStatusVIreturnsamulti-axisstatusbitmapofthestatustypeselected.Youcanselectoneofthefollowingthreetrajectorystatustypes:
Run/StopStatus
Run/Stopstatusisupdatedbasedonfilteredvelocityandrun/stopcriteriasetbytheLoadRun/StopThresholdVI.Thestatusissetwhentheaxisistravellingfastenoughtobeconsideredrunning.TheaxisisconsideredtoberunningwhenthechangeinpositionpersampleperiodexceedstheRun/StopthresholdsetwiththeLoadRun/StopThresholdVI.
MotorOffStatus
AmotorcanbeOfffortworeasons.Eitherakillstopwasexecutedorthefollowingerrortrippointwasexceeded.AMotorOffconditionalsomeansthatanenabledinhibitoutputisactive.RefertotheConfigureInhibitOutputsVIformoreinformation.
VelocityThresholdStatus
TheVelocityThresholdstatusindicateswhethertheaxisvelocityisabove(True)orbelow(False)theprogrammedvelocitythreshold.RefertotheLoadVelocityThresholdVIforinformationaboutsettingandusingavelocitythreshold.
MoveComplete
TheMoveCompletestatusindicateswhetheranaxisorvectorspaceisinthemovecompletestate,whichisthedefaultwhenanaxisorvectorspaceisidle.Whileamoveisinprogress,themovecompletestatusisfalse.Foramovetobecompleteonavectorspace,themovecompletestatusmustbetrueonallaxesinthevectorspace.
Duringavectorspacemove,ifoneaxisinavectorspacetripsoutonafollowingerror,thataxisiskilled,andthemovecompletestatusremainsfalse.
ArcVIsYoucanuseArcVIstoloadparametersforcircularlyinterpolatedmoves.Itincludes2Dcirculararcs,3Dhelicalarcs,andfull3DsphericalarcsVIs.
CircularinterpolationisanadvancedfeatureofNI-Motionandisprimarilyusedincontinuouspathapplicationssuchasmachining,patterncutting,liquiddispensing,robotics,andsoon.Formaximumsmoothnessandaccuracy,theNI-MotionDSPimplementsarcsthroughacubicsplinealgorithm.
ArcVIsarealwayssenttoavectorspace.VelocityandaccelerationparametersloadedbyexecutingthoseVIsonthevectorspaceareusedasthevectorvelocityandvectoraccelerationforallsubsequentarcmoves.Allarcparametersaredouble-bufferedandtakeeffectuponthenextStartMotionorBlendMotionVIexecution.
NoteArcradiusdeterminesthepracticalrangeforvectoraccelerationandvelocity.Unrealizablevectorvaluesgenerateanerrorandthestartorblenddoesnotexecute.
Youcanblendarcmovesintolinearlyinterpolatedmovesandviceversa.YoualsocanloadallaxesinthevectorspaceinthesameblendfactorwiththeLoadBlendFactorVI.
Arcmovesaredefinedrelativetotheirstartingpositionandassuch,areinherentlyoperatedinrelativepositionmode.Thisapproachguaranteesthattheaxesarealreadyonthecircleinthex'y'plane,andavoidsanyimpossiblesituationswheretheendpointofthelastmoveandthebeginningofthearcmovearenotcoincident.ThemodeselectedwiththeSetOperationModeVIhasnoeffectonthearcmove.Itcan,however,affectthelinearlyinterpolatedvectormoveyoumightbeblendingintoorfrom.
ClicktheiconsforVIdescriptions.
LoadCircularArc
LoadSphericalArc
LoadHelicalArc
LoadCircularArcLoadsparametersformakingacirculararcmoveina2Dor3Dvectorspace.
DetailsRemarks
DeviceCompatibility
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.VectorSpaceisthevectorspacetocontrol.InpVectindicatesthesourceofthedataforthisVI.Availableinputvectorsincludeimmediate(0xFF),variable(0x01through0x78),orindirectvariable(0x81through0xF8).RefertoInputandReturnVectorsformoredetailedinformation.
NoteTheconversionfromfloating-pointtofixed-pointisperformedonthehostcomputer,notonthemotioncontroller.ToloadarcVIsfromonboardvariables,youmustusethe16.16fixed-pointrepresentationforallangles.
errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowing
UsingThisVI
TheLoadCircularArcVIdefinesanarcinthexyplaneofa2Dor3Dvectorspace.
NoteLoadthevelocityandacceleration/decelerationbeforeloadinganarc.
Thearcisspecifiedbyaradius,startingangle,andtravelangleandlikeallvectorspacemoves,usestheloadedvaluesofvectoraccelerationandvectorvelocitytodefinethemotionalongthepathofthearc.Thefollowingfiguredefinesacirculararc.
1CircularArc 3StartingPosition 5Radius2TravelAngle 4StartAngle 6EndingPosition
Circulararcsarenotlimitedto±360°.Movesofover4,000circularrevolutionsineitherdirectioncanbestartedwithonecalltothisVI.
NoteIfyouaredoingonboardprogrammingandareusingInpVecttogetthedatathisVIneeds,rememberthatthisVIreadsthevariablesstartingatthememoryaddresspointedtobyInpVectinthefollowingorder:Radius,StartAngle,TravelAngle.
RefertoNI73xxArcAnglesinDegreesformoreinformationaboutrepresentinganglesnumerically.
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NI73xxControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwitha73xxmotioncontroller:
TherangeforRadius(2)is2to231–1counts(steps).TherangeforStartAngle(0)is0to359.999313°whereangle0isalongthepositivexaxisandvaluesincreasecounterclockwisefromthepositivexaxisinthexyplane.TherangeforTravelAngle(0)is–1,474,560°to+1,474,200°(–4,096to+4,095revolutions).
NISoftMotionControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwiththeNISoftMotionController:
TherangeforRadius(2)is0to231–1counts(steps).TherangeforStartAngle(0)is0to360°whereangle0isalongthepositivexaxisandvaluesincreasecounterclockwisefromthepositivexaxisinthexyplane.TherangeforTravelAngle(0)isthefull64-bitrange.
LoadHelicalArcLoadsparametersformakingahelicalarcmoveina3Dvectorspace.
DetailsRemarks
DeviceCompatibility
LinearTravel(0)isthelineartravelofthezaxisincounts(servoaxes)orsteps(stepperaxes).
NoteLoadingazero(0)forLinearTravelreducesthehelicalarctoacirculararc.
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.VectorSpaceisthevectorspacetocontrol.InpVectindicatesthesourceofthedataforthisVI.Availableinputvectorsincludeimmediate(0xFF),variable(0x01through0x78),orindirectvariable(0x81through0xF8).RefertoInputandReturnVectorsformoredetailedinformation.
Note
Theconversionfromfloating-pointtofixed-pointisperformedonthehostcomputer,notonthemotioncontroller.ToloadarcVIsfromonboardvariables,youmustusethe16.16fixed-pointrepresentationforallangles.
errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIruns
UsingThisVI
TheLoadHelicalArcVIdefinesanarcin3Dvectorspacethatconsistsofacircleinthexyplaneandsynchronizedlineartravelinthezaxis.
NoteLoadthevelocityandacceleration/decelerationbeforeloadinganarc.
Thearcisspecifiedbyaradius,startingangle,travelangle,andzaxislineartravel,andlikeallvectorspacemoves,usestheloadedvaluesofvectoraccelerationandvectorvelocitytodefinethemotionalongthehelicalpathofthearc.Thefollowingfiguredefinesahelicalarc.
1HelicalArc 3StartAngle 5Radius 7EndingPosition2TravelAngle 4StartingPosition 6LinearTravel
Likecirculararcs,helicalarcsarenotlimitedto±360°.Movesofupto4,096helicaltwistsineitherdirectioncanbestartedwithonecalltothisVI.
NoteIfyouaredoingonboardprogrammingandareusingInpVecttogetthedatathisVIneeds,rememberthatthisVIreadsthevariablesstartingatthememoryaddresspointedtobyInpVectinthefollowingorder:Radius,StartAngle,TravelAngle,LinearTravel.
RefertoNI73xxArcAnglesinDegreesformoreinformationaboutrepresentinganglesnumerically.
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NI73xxControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwitha73xxmotioncontroller:
TherangeforLinearTravel(0)is–(231)to+(231–1)counts(steps).TherangeforRadius(2)is2to231–1counts(steps).TherangeforStartAngle(0)is0to359.999313°whereangle0isalongthepositivexaxisandvaluesincreasecounterclockwisefromthepositivexaxisinthexyplane.TherangeforTravelAngle(0)is–1,474,560°to+1,474,200°(–4,096to+4,095revolutions).
NISoftMotionControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwiththeNISoftMotionController:
TherangeforLinearTravel(0)-(±231–1).TherangeforRadius(2)is0to231–1counts(steps).TherangeforStartAngle(0)is0to360°whereangle0isalongthepositivexaxisandvaluesincreasecounterclockwisefromthepositivexaxisinthexyplane.TherangeforTravelAngle(0)isthefull64-bitrange.
LoadSphericalArcLoadsparametersformakingasphericalarcmoveina3Dvectorspace.
DetailsRemarks
DeviceCompatibility
PlaneYaw(0)isthedoubleprecisionfloatingpointvalue,indegrees,oftheanglebetweenthex'andxaxeswhentheentirex'y'z'vectorspaceisrotatedaroundthezaxis.Thez'axisremainsalignedwiththezaxis.WhenPlaneYawequals90°,thepositivex'axisisalignedwiththepositiveyaxis.
NoteLoadingzerosforPlanePitchandPlaneYawreducesthesphericalarctoacirculararc.
Internally,thefloating-pointvaluesforPlanePitch,PlaneYaw,StartAngle,andTravelAnglearerepresentedasscaled,fixedpointnumbers.
PlanePitch(0)isthedoubleprecisionfloatingpointvalue,indegrees,oftheanglebetweenthex'andxaxeswhentheentirex'y'z'vectorspaceisrotatedaroundtheyaxis.They'axisremainsalignedwiththeyaxis.WhenPlanePitchequals90°,thepositivex'axisisalignedwiththenegativezaxis.
UsingThisVI
TheLoadSphericalArcVIdefinesanarcinthex'y'planeofacoordinatesystemthathastobetransformedbyrotationinpitchandyawfromthenormal3Dvectorspace(xyz).Inthetransformedx'y'z'space,thesphericalarcisreducedtoasimplercirculararc.Itisspecifiedbyaradius,startingangle,andtravelangle,andlikeallvectorspacemoves,usestheloadedvaluesofvectoraccelerationandvectorvelocitytodefinethemotionalongthepathofthearcinthex'y'plane.
NoteLoadthevelocityandacceleration/decelerationbeforeloadinganarc.
Thefollowingfigureshowsagraphicrepresentationofthetransformationbetweenthex'y'z'andxyzcoordinatespaces.TheformaldefinitionsofPlanePitchandPlaneYawarelistedintheprevioussection.
Pitchandyawtransformationsareinherentlyconfusingbecausetheyinteract.Toavoidambiguities,youcanthinkaboutsphericalarcsandcoordinatetransformationsasfollows:
Thesphericalarcisdefinedasacirculararcinthex'y'planeofatransformedvectorspacex'y'z'.TheoriginalvectorspacexyzisdefinedbytheConfigureVectorSpaceVI.Thetransformedvectorspacex'y'z'isdefinedinorientationonly,withnoabsolutepositionoffset.Itsorientationiswithrespecttothexyzvectorspaceandisdefinedintermsofpitchandyawangles.Yawanglerotationcomesbeforepitchanglerotation.Whenrotatingthroughtheyawangle,they'axisneverleavestheoriginalxyplaneasthenewlydefinedx'y'z'vectorspacerotatesaroundtheoriginalzaxis.Whenrotatingthroughthepitchangle,theyandy'axesstayalignedwitheachotherwhilethex'z'planerotatesaroundthem.Atthebeginningofthemove,theaxesareconsideredtobealreadyonthearcinthex'y'plane.Thisavoidsanyimpossiblesituationswheretheendpointofthelastmoveandthebeginningofthearcmovearenot
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NI73xxControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwitha73xxmotioncontroller:
TherangeforRadius(2)is2to231–1counts(steps).TherangeforPlanePitch(0)is0to90°.TherangeforPlaneYaw(0)is0to359.999313°.TherangeforStartAngle(0)is0to359.999313°whereangle0isalongthepositivexaxisandvaluesincreasecounterclockwisefromthepositivexaxisinthexyplane.TherangeforTravelAngle(0)is–1,474,560°to+1,474,200°(–4,096to+4,095revolutions).
NISoftMotionControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwiththeNISoftMotionController:
TherangeforRadius(2)is0to231–1counts(steps).TherangeforPlanePitch(0)is0to360°.TherangeforPlaneYaw(0)is0to360°.TherangeforStartAngle(0)is0to360°whereangle0isalongthepositivexaxisandvaluesincreasecounterclockwisefromthepositivexaxisinthexyplane.TherangeforTravelAngle(0)isthefull64-bitrange.
GearingandCammingVIsYoucanuseGearingandCammingVIstosetupandcontrolmaster-slavegearingandcammingontheNImotioncontroller.ItincludesVIstoconfigureagearmaster,loadagearratio,configureacammingmaster,enablecamming,andsoon.
GearingandcammingareadvancedfeaturesofNI-MotionandareusedinapplicationswhereeitherthemasteraxisisnotundercontroloftheNImotioncontrollerorwhenextremelytightsynchronizationbetweenmultipleaxesisrequired.
NoteIfyouaregearingasteppermotorandthegearratioissuchthattheslaveaxisexceedsthemaximumsteppervelocitywhenthemasterdoesnot,theslaveaxisdoesnotmoveandmaytriponfollowingerror.Topreventthis,ensurethegearratiodoesnotpermittheslaveaxistoexceedthemaximumsteppervelocity.Refertoyourmotioncontrollerdocumentationforinformationaboutmaximumsteppervelocities.
ClicktheiconsforVIdescriptions.
ConfigureGearMaster
LoadGearRatio
EnableGearing
EnableGearingSingleAxis
ConfigureCammingMaster
LoadCammingParameter
EnableCamming
EnableCammingSingleAxis
ConfigureCammingMasterConfiguresthemasterdeviceforcammingoperation.
DetailsRemarks
DeviceCompatibility
MasterCycleistherepeatperiodforthemasterdevice.CammingMasteristheaxis,encoder,orADCchanneltouseasthemaster.BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.AxisIDistheaxistoconfigure.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,
UsingThisVI
UsethisVItoassignamasteraxis,encoder,orADCchanneltotheslaveaxisselectedforthecammingapplication.Anynumberofslaveaxescanhavethesamemaster,buteachslaveaxismusthaveonlyonemaster.
Beforestartingthecammingoperation,youmustconfigurethemasterdevice.Usinganaxisasthemasterdeviceallowstheslaveaxistofollowthetrajectorygenerationoutputofthemasteraxis.Thisfunctionalityisusefulwhenthemasteraxisisanopen-loopsystemorwhenitisusedforhandlingthelatencyofafeedbackdevice(encoderorADC),whichcauseshighfollowingerror.
Youalsocanuseafeedbackdevice,suchasanencoderorADC,asthemasterdevicesothatanymovementmadebythemasterisimmediatelypropagatedtotheslave.
Themasterdevicepositionisinterpreted,ormodularized,withinthemastercycle,whichallowsthecammingoperationtorepeatcontinuouslyasthemasterdevicemoves.Alongwithslavepositions,themastercycleisusedtocalculatethecammingratioatanytime.
Forexample,ifthemastercycleis5,000andthecurrentmasterpositionis12,500,themasterpositioninsidethemastercycleis
position=((12,500modulus5,000)=2,500)
Usingthepreviousmastercyclebutwithamasterpositionof-4,000,themasterpositioninsidethecycleis
position=((-4,000modulus5,000)=1,000)
YoualsocanusetheLoadCammingParameterVItochangethecammingcycle.
RefertotheCammingsectionoftheNI-MotionHelpformoreinformationaboutcammingoperations.
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NISoftMotionControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwiththeNISoftMotionController:
TheNISoftMotionControllerdoesnotsupportusinganalogfeedbackasthecammingmaster.
ConfigureGearMasterAssignsamasteraxis,encoder,orADCchannelformaster-slavegearing.
DetailsRemarks
DeviceCompatibility
MasterAxisEncoderorADCistheaxis(1through15)trajectorygenerator,encoder(0x21through0x2F),orADCchannel(0x51through0x5F)touseasthemasterforthisslaveaxis.Azero(0)valuemeansnomasterisassigned(default).
NoteAxisandMasterAxis,Encoder,orADCcannotbethesamebecauseanaxiscannotbeitsownmaster.
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.Axisistheslaveaxistocontrol.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,
UsingThisVI
TheConfigureGearMasterVIassignsamasteraxis,encoder,orADCchanneltotheslaveaxisselected.Anynumberofslaveaxescanhavethesamemaster,buteachslaveaxiscanhaveonlyonemaster.Aslaveaxismayalsoserveasmasteraxisforanynumberofslaveaxes.
YoumustcalltheConfigureGearMasterVIpriortoenablingmaster-slavegearingwiththeEnableGearingVI.Typically,thesourceforthemasterpositionisanindependentencoder,anADCchannel,orthefeedbackresourceofanenabledaxis.Ineachcase,youassigntheresource,nottheaxis,asthemaster.Thegearmaster,whichcanbeanaxis,encoder,orADC,mustbeenabledbeforeyoucanusethisVI.UsetheEnableAxes,EnableEncoders,orEnableADCsVIstoenablethegearmaster.
Whenanaxisisassignedasthemaster,itstrajectorygeneratoroutput(notitsfeedbackposition)isusedasthemasterpositioncommand.Thismodeofoperationcaneliminatethefollowingerrorskewbetweenthemasterandslaveaxesandisespeciallyusefulingantryapplications.Themasteraxiscanoperateinanymode(includingasaslavetoanothermaster).
Master-slavefunctionalityofslaveaxesisinadditiontotheirnormalmodeofoperation.Thisallowsapoint-to-pointmovetobesuperimposedupontheslavewhiletheslaveaxisisinmotionduetobeinggearedtoitsmaster.Thisfunctionalityisusefulforregistrationandreferenceoffsetmoves.RefertotheGearingsectionoftheNI-MotionHelpforinformationaboutusingsuperimposedmoves/registrationapplications.Also,refertotheRotatingKnifesectionoftheNI-MotionHelpforexamplecodethatincludessuperimposedmoves.
RefertotheLoadGearRatioandEnableGearingVIsformoreinformationaboutmaster-slavegearing.
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NISoftMotionControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwiththeNISoftMotionController:
TheNISoftMotionControllerdoesnotsupportusinganalogfeedbackasthegearmaster(analoggearing).
EnableCammingEnablescammingoperationformultipleaxes.
Details
DeviceCompatibility
EnableDataisanarrayofclustersthatincludethefollowingelements:Axisistheaxisyouwanttostartorstopcammingoperationon.Enableindicatesifthecammingisstarted(True)orstopped(False)ontheselectedAxis.Positionisthepositiontostartorstopthecammingat.Thevalidrangeis–1or0through(mastercycle–1).
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroora
UsingThisVI
UsethisVItosimultaneouslystartorstopacammingoperationonmultipleaxes.ThedefaultvalueforthePositionelementoftheEnableDataarrayis–1,whichstartscammingimmediately.Tostartcammingataspecificmasterposition,setthisparametertoavaluebetween0and(mastercycle–1).
RefertotheCammingsectionoftheNI-MotionHelpformoreinformationaboutcammingoperations.
EnableCammingSingleAxisEnablescammingoperationforthecurrentaxis.
Details
DeviceCompatibility
Positionisthepositiontobegincammingat.Thedefaultis–1,andthevalidrangeis–1or0through(mastercycle–1).Enableenables/disablescammingonthespecifiedaxis.SetEnabletoTRUEtoenablecammingorFALSEtodisablecamming.BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.AxisIDistheaxistoconfigure.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.
UsingThisVI
UsethisVItostartorstopacammingoperationonanaxis.YoucanstartorstopthecammingoperationimmediatelybysettingPositionto–1.Toconfigurethecammingoperationtotakeplaceafterthemasterdevicecrossesaspecificpositioninsidethemastercycle,setPositiontoavaluebetween0and(mastercycle–1).
RefertotheCammingsectionoftheNI-MotionHelpformoreinformationaboutcammingoperations.
EnableGearingEnablesslaveaxesformaster-slavegearing.
Details
DeviceCompatibility
Gearing(Disable)isthebitmapofslaveaxestoenableforgearing.Axis1—Iftrue,gearingisenabled.Iffalse,gearingisdisabled(default).Axis2—Iftrue,gearingisenabled.Iffalse,gearingisdisabled(default).Axis3—Iftrue,gearingisenabled.Iffalse,gearingisdisabled(default).Axis4—Iftrue,gearingisenabled.Iffalse,gearingisdisabled(default).Axis5—Iftrue,gearingisenabled.Iffalse,gearingisdisabled(default).Axis6—Iftrue,gearingisenabled.Iffalse,gearingisdisabled(default).Axis7—Iftrue,gearingisenabled.Iffalse,gearingisdisabled(default).Axis8—Iftrue,gearingisenabled.Iffalse,gearingisdisabled(default).
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.errorin(noerror)describeserrorconditionsthatoccurbeforethisVI
UsingThisVI
TheEnableGearingVIenablesanddisablesmaster-slavegearingfunctionalityofslaveaxes.Whengearingisenabled,thepositionsoftheslaveaxesandtheircorrespondingmastersarerecordedastheirabsolutegearingreference.Foraxesandencoders,thecurrentpositionisthevaluerecorded.ForADCs,thebinaryvalueisrecorded.Fromthenon,aslongasthegearratioremainsabsolute,everyincrementalchangeofamasterpositionismultipliedbythecorrespondingabsolutegearratioandappliedtotheslaveaxis.RefertotheLoadGearRatioVIforinformationaboutabsoluteversusrelativegearratios.
NoteChangingtheabsolutegearratiocausestheslaveaxestojumptoanewpositionspecifiedbythenewgearratio.Withservomotorsystemstheslavejumpsimmediately.Withsteppersystems,ifthenewslavepositioniswithin4,000steps,itjumpstothenewposition.Otherwise,theslaveaxiswaitsuntilthecommandedslavepositionmovestowithin4,000stepsandthenjumpstothenewposition.Theslaveaxisthenresumesfollowingthemasteraxisaccordingtothegearratio.
YoumustcalltheConfigureGearMasterandLoadGearRatioVIspriortoenablingmaster-slavegearing.Inaddition,youmustenableandactivatetheslaveaxesbeforeenablinggearing.Anerrorisgeneratedifaslaveiskilledwhengearingisenabled.Thesechecksensurethattheslaveaxisenablesinacontrolledfashion.
NoteIfyouarerunningaslaveaxismovewithastepperaxis,itispossiblethattheslaveaxisgearedvelocityexceedsthemaximumsteprateofthecontroller.Inthiscase,thecontrollerkillstheaxisandsetsthefollowingerrorstatustotrue.RefertotheSpecificationssectionofyourcontrollerusermanualforthemaximumsteprateofyourcontroller.
YoucancalltheEnableGearingVIatanytimetodisablegearingortore-enablegearingwithnewabsolutegearingreferencepositions.Ifgearingisdisabledonamovingaxis,theaxisimmediatelystopsbutremainsactive.Iftheslaveaxiswasalsoimplementingasuperimposedmove,thesuperimposedmovedeceleratestoastop.
EnableGearingSingleAxisEnablesslaveaxisformaster-slavegearing.
Details
DeviceCompatibility
Gearing(Disable)indicateswhethertoenableordisabletheslaveaxisforgearing.Iftrue,gearingisenabled.Iffalse,gearingisdisabled(default).BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.Axisistheslaveaxistoenableordisable.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.UsetheerrorhandlerVIstolookupthemeaningofthiscodeanddisplaythecorrespondingerrormessage.
UsingThisVI
ThisVIissimilartotheEnableGearingVI,butallowsyoutoenableordisablegearingonasingleaxiswithoutaffectingtheotheraxes.
TheEnableGearingSingleAxisVIenablesanddisablesmaster-slavegearingfunctionalityofaslaveaxis.Whengearingisenabled,thepositionoftheslaveaxisanditscorrespondingmasterisrecordedasitsabsolutegearingreference.Fromthenon,aslongasthegearratioremainsabsolute,everyincrementalchangeofamasterpositionismultipliedbythecorrespondingabsolutegearratioandappliedtotheslaveaxis.RefertotheLoadGearRatioVIforinformationaboutabsoluteversusrelativegearratios.
NoteChangingtheabsolutegearratiocausestheslaveaxestojumptoanewpositionspecifiedbythenewgearratio.Withservomotorsystemstheslavejumpsimmediately.Withsteppersystems,ifthenewslavepositioniswithin4,000steps,itjumpstothenewposition.Otherwise,theslaveaxiswaitsuntilthecommandedslavepositionmovestowithin4,000stepsandthenjumpstothenewposition.Theslaveaxisthenresumesfollowingthemasteraxisaccordingtothegearratio.
YoumustcalltheConfigureGearMasterandLoadGearRatioVIspriortoenablingmaster-slavegearing.Inaddition,youmustenableandactivatetheslaveaxisbeforeenablinggearing.Anerrorisgeneratediftheslaveiskilledwhengearingisenabled.Thesechecksensurethattheslaveaxisenablesinacontrolledfashion.
NoteIfyouarerunningaslaveaxismovewithastepperaxis,itispossiblethattheslaveaxisgearedvelocityexceedsthemaximumsteprateofthecontroller.Inthiscase,thecontrollerkillstheaxisandsetsthefollowingerrorstatustotrue.RefertotheSpecificationssectionofyourcontrollerusermanualforthemaximumsteprateofyourcontroller.
YoucancalltheEnableGearingSingleAxisVIatanytimetodisablegearingortore-enablegearingwithnewabsolutegearingreferencepositions.Ifgearingisdisabledonamovingaxis,theaxisimmediatelystopsbutremains
LoadCammingParameterLoadsothercammingparameters,suchasmasteraxispositionoffsetandslaveaxispositionoffset.
Details
DeviceCompatibility
DataisaclusterofvariablesthatcontainsthevaluesfortheselectedAttribute.
Integeris32-bitintegerdata.Doubleis64-bitfloatingpointdata.BooleanisBooleandata.
Attributeistheattributetoconfigure.Thefollowinglistincludesvalidattributes:
MasterCycle—SettheDoubleelementoftheDataclustertothemastercycleinuserunits.Themastercycleindicateshowoftenthecammingcyclerepeatsitself.Forexample,ifyouspecify8,000countsfortheMasterCycle,thecammingrepeatsitselfevery8,000counts.MasterOffset—DoubleelementoftheDataclustertothemasteroffsetinuserunits.Masteroffsettakesintoaccountthepositiondifferencebetweenthecurrentpositionofthemasteraxisandthepositionatwhichthecammingbegins.Rangeis0to(MasterCycle–1).
UsingThisVI
UsethisVItoconfigurevariousparametersofthecammingoperation:
MasterCycledefineswhenthecammingoperationisgoingtorepeatbasedonthemasterposition.YoucanconfigurethemastercycleatthesametimeyouconfigurethecammingmasterusingtheConfigureCammingMasterVI.
NoteYoucannotchangethemastercycleaftercammingisenabled.MasterOffsetisappliedtothemasterpositionwhencammingisenabled.Thisattributeshiftsthepositionmodulustocompensateforthefactthatthecammingcyclemaynotstartat0.Forexample,ifyouhaveamastercycleof4,000andamasteroffsetof0,thecammingoperationrepeatsat...,-8,000,-4,000,0,4,000,8,000,...Ifyouchangethemasteroffsetto1000,thecammingoperationrepeatsat...,-7,000,-3,000,1,000,5,000,9,000,....
Thedefaultvalueforthemasteroffsetis0,andthevalidrangeofvaluesforthemasteroffsetis0to(MasterCycle–1).
TipThemasteroffsetisappliedonlywhencammingisstartedorenabled.
SlaveOffsetisappliedwhenthecammingcyclebegins.Thisoffsetisusedtoadjustthecammingprofilewhenthebeginningandendingpositionsfortheslaveaxisarenotthesame.Youcanchangetheslaveoffsetatanytime,butthechangetakeseffectonthenextcammingcycle.
Thedefaultvalueis0.
RefertotheCammingsectionoftheNI-MotionHelpformoreinformationaboutcammingoperations.
LoadGearRatioLoadsthegearratioformaster-slavegearing.
Details
DeviceCompatibility
Gearing(Absolute)selectsabsoluteFALSEorrelativeTRUEgearingbetweenthemasterandslave.BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.Axisistheslaveaxistocontrol.InpVectcontainsthetype,numerator,anddenominatorparametersthatarethesourceofdataforthisVI.
Availableinputvectorsincludeimmediate(0xFF),variable(0x01through0x78),orindirectvariable(0x81through0xF8).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.If
UsingThisVI
TheLoadGearRatioVIloadsthegearratiooftheslaveaxisrelativetoitsmasterandselectswhetherthisratioisabsoluteorrelative.Theratioisloadedasanumeratoranddenominatorbecauseitisanaturalformatforaratio(numerator:denominator)anditallowsabroadrangeofratios,from1:32,767to32,767:1.Theratioisalwaysspecifiedasslaverelativetomaster(slave:master).
WhenyouexecutetheEnableGearingVI,thepositionsoftheslaveanditsmasterarerecordedastheirabsolutegearingreference.Fromthenon,aslongasthegearratioremainsabsolute,everyincrementalchangeofthemaster'spositionismultipliedbytheabsolutegearratioandappliedtotheslaveaxis.
Ifarelativegearratioisselectedandloadedaftergearingisenabled,thepositionofthemasterisrecordedasitsrelativereferencepointandeveryincrementalchangefromthisreferencepointismultipliedbytherelativegearratioandappliedtotheslaveaxisoraxes.
NoteWhilechanginganabsolutegearratioontheflyisallowed,youmustbecarefulbecausetheslaveaxisjumpswithfulltorquetothepositiondefinedbythenewratioevenwhenthemasterpositionhasnotchanged.Similarly,resettingthepositiononamasteraxisalsocausesitsslaveaxestojumptoanewpositionrelativetothenewpositionofthemasteraxis.
TheLoadGearRatioVImustbecalledpriortoenablingmaster-slavegearingwiththeEnableGearingVI.Oftenthepositionsofthemasterandslaveareresettozeroorsomeknownpositionpriortoenablinggearing,thoughthisisnotalwaysrequired.TheexecutionoftheEnableGearingVIstoresbothpositionsasoffsetsandgearsthemfromthatpointonward.
Relativegearingchangesthespecifiedpositionoftheslaveaxisonlywhenthemastermoves.Itusesthelengthofthecurrentmoveofthemasteraxistocalculatehowfartomovetheslaveaxis.Attheendofthemove,iftheslaveaxisisnotattheexactposition,thepositionerrorisdiscarded.Thismay
BufferedOperationsVIsBufferedoperationsallowyoutocreateandmanagememorybuffersontheNImotioncontroller.Youcancreatebuffersthatcanholdupto16,364points,readandwritedatatoandfromthesebuffers,andcheckthestatusofabuffer.BufferscanevenbestoredinROMforlateruse.
Onboardbuffersallowyoutostoremuchmoredatathanthe120onboardvariables.Datacanbemovedbackandforthbetweenbuffersandonboardvariablesbyusinginputandreturnvectors.
Forexample,anonboardbuffercanbecreatedtoholdaseriesoftargetpositionstomoveto,oneafteranother.Anonboardprogramiswrittentoreadapositionfromthebuffertoanonboardvariable,thenusethatvaluetoloadatargetposition,startamove,andwaitforthemovetocomplete.Thesameprocessisrepeatedforeachtargetpositionuntiltheentirebufferofpositionsisconsumed.Thisapproachallowsforalargenumberofmovestoexecuteindependentofthehostcomputer.
Besidessingle-shotapplicationswherethebufferholdsallofthedataorisfilledwithallofthedataonlyonce,itispossibletouseanonboardbufferinacontinuousfashion,allowingforverylargeamountsofdatatotransfertoorfromthemotioncontroller.UsetheCheckBufferVItodeterminethenumberofpointsthatcanbesafelywrittentoorreadfromtheonboardbufferatanypointintime.
The7350and7340controllershavethefollowingonboardmemory:
Controller RAM ROM7340 164ksector 264ksectors7350 264ksectors 464ksectors
YoucanaccessabufferfromeitherRAMorROM,butyoucannotsplitbuffersbetweenthetwo,andyoucannotsplitbuffersbetweenthe64KBROMsectors.
Contouringisaspecialmovementmodeimplementedontopofthebufferedoperations.Contouringallowsyoutospecifyaseriesofpositionsnmilliseconds
apartforthemotioncontrollertosplinethrough.
YoucanusetheBufferedOperationsVIstoperformbufferedhigh-speedcapturesandbufferedbreakpoints.Theseallowyoutoachievefasterratesthanwouldotherwisebepossiblebyautomaticallystoringcapturedpositionsorautomaticallyloadingbreakpoints.RefertoHigh-SpeedCaptureOverviewandBreakpointOverviewformoreinformation.
NoteConfiguringandclearingbuffersisaprocessor-intensiveoperationontheNImotioncontrollerthatrequirestheallocationandde-allocationofmemory.Configureandclearbuffersonlywhenmotorsarenotmovingandonboardprogramsarenotrunning.
ClicktheiconsforVIdescriptions.
ConfigureBuffer
WriteBuffer
ReadBuffer
CheckBuffer
ClearBuffer
CheckBufferReturnsinformationaboutthecurrentstateofthebuffer.
Details
DeviceCompatibility
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.Bufferisthebuffertoconfigure.Validbuffernumbersare1through255(0x01through0xFF).RetVectindicatesthedestinationforthereturndatageneratedbythisVI.Availablereturnvectorsincludereturndatatothehost(0xFF),returndatatoavariable(0x01through0x78),returndatatoanindirectvariable(0x81through0xF8),anddonotreturndata(0).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroora
UsingThisVI
TheCheckBufferVIprovidesyouwithcurrentinformationaboutthestateofthebuffer.Insingleiterationsituations,meaningTotalPointsislessthanorequaltoBufferSizeintheConfigureBufferVI,theBufferStateparameterismostusefulindeterminingthattheoperationhascompleted.
Forafiner-resolutionviewofthestateofthebuffer,theBacklogparameterindicatesthenumberofpointsthatcansafelybewrittentoorreadfromthebufferwithoutviolatingtheOldDataStopcondition.RefertoConfigureBufferformoreinformation.
PointsDoneisthenumberofpointsreadfromthebufferbythecontroller,inthecaseofanoutputbuffer,orwrittentothebufferbythecontroller,inthecaseofaninputbuffer.PointsDoneisfromthepointofviewofthecontroller,ratherthantheuser.
Asanexample,inthecaseofcontouring,Backloghelpsyoudeterminewhenyoucanwritemoredatatothebuffer,whilePointsDonetellsyouhowmanypointshaveactuallybeensplinedtogetherbythecontroller.PointsDonereflectswhatishappeningintherealworld,wheremotionoccurs.
NoteThisVIreturnsdatainthefollowingorder:Backlog,BufferState,andPointsDone.
OutputBufferExample
Afteryouconfigurea10-pointbufferforcontouring,thecontentsareindeterminateandboththereadandwriteheadsareatposition0.
Write:0Read:0
Inwritingthevalues1through5toabuffer,thewriteheadmovestothesixthpositioninthebuffer,wherethenextwritetakesplace.Thereadheadisstillatposition0becauseithasreadnodatafromthebuffer.Likewise,PointsDoneisstill0.
ClearBufferClearsthepreviouslyconfiguredbufferandclearsanyassociationsbetweenresourcesandthespecifiedbuffer.
Details
DeviceCompatibility
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.Bufferisthebuffertoconfigure.Validbuffernumbersare1through255(0x01through0xFF).errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.UsetheerrorhandlerVIstolookupthemeaningofthiscodeanddisplaythecorrespondingerrormessage.sourceisastringthatindicatestheoriginoftheerror,ifany.Typically,sourceisthenameoftheVIinwhichtheerroroccurred.
UsingThisVI
Afterabufferedoperationcompletes,itisimportanttoclearthebufferbycallingtheClearBufferVI.Otherwise,thememoryallocatedforthebufferintheonboardRAMisnotavailableforotheruses,suchastheallocationofanotherbufferorthestorageofanonboardprogram.
Abuffercannotbeclearedwhileitisinuse.Ifyoutrytoclearabufferwhileitisinuse,theClearBufferVIgeneratesaBufferInUseerror.
NoteConfiguringandclearingbuffersisaprocessor-intensiveoperationonthemotioncontrollerthatrequirestheallocationanddeallocationofmemory.Youmustconfigureandclearbuffersonlywhenmotorsarenotmovingandonboardprogramsarenotrunning.Forexample,ifyouwishtoexecutethreesimultaneouscontouringoperationsonaxis1,axis2,andvectorspace1(withaxes3and4),youmustfirstconfigureallthreebuffersbeforestartinganyoftheoperations.Youcanstartthecontouroperationsindependently,andatdifferenttimes,butwaituntilalloperationsarecompletebeforeclearinganyofthebuffers.
AdvancedUses
ThisVIonlyclearsabufferfromRAM.IfyousaveabuffertoROMusingtheObjectMemoryManagementVI,youmustdeletethebufferfromROMusingtheObjectMemoryManagementVI.IfyoucalltheClearBufferVIandspecifyabufferthatresidesinROM,theassociationbetweentheresourceandthebufferiscleared,butthebufferremainsinROM.
NoteYoucannotclearabufferthatisattachedtoanaxisthatismoving.Youcanclearabufferthatisactive,suchasahigh-speedcapturebufferthatiswaitingforatrigger,butNI-Motionreturnsanerrorinthiscase.
Ifmultipleresourcesrefertothesamebuffer,allassociationsfromallresourcestothespecifiedbufferarecleared.RefertotheAdvancedUsessectionintheConfigureBufferVIdescriptionformoreinformation.
ConfigureBufferConfiguresabufferforuseinbufferedoperations.
DetailsRemarks
DeviceCompatibility
OldDataStop(True)indicatestothemotioncontrollerwhetherornottostopreadingfromorwritingtothebufferwhenolder,unreaddataisencountered.ThisisonlyrelevantwhenTotalPointsisgreaterthanBufferSize.Intheoutputcase,suchascontouring,whenOldDataStopistrueandTotalPointsisgreaterthanBufferSize,youmustwritenewdatatothebufferbeforethemotioncontrollerfinishesthebufferandstartsoveratthebeginning.Likewise,foraninputbuffer,ifthecontroller(oranonboardprogramrunningonthecontroller)iswritingdatatothebuffer,suchasbufferedhigh-speedcapturedata,youmustreaddataoutofthebufferbeforethecontrollerwrapsaroundandwritesnewdataontopoftheolddata.
IfyousetOldDataStoptofalse,themotioncontrollerdoesnotenforcetheolddatastopcondition,andsimplywritesdatatoorreadsdatafromthebufferasneeded.
RequestedInterval(10ms)isadditionaldataforthePositionbuffertype.ThePositionbuffertyperequiresaRequestedIntervalparameter,andindicatesthetimebetweencontouringdatapointsinmilliseconds.Forallotherbuffertypes,theRequestedIntervalparameterisignored.
UsingThisVI
Afterabufferisconfigured,youcanwritetothebufferwiththeWriteBufferVIandreadfromthebufferwiththeReadBufferVI.
AcontouroperationthatusesabufferisinitiatedwhentheStartMotionVIiscalled.YoucheckthestateofthebufferwiththeCheckBufferVItodeterminehowmanypointshavebeenreadfromorwrittentothebufferbythemotioncontroller.
Afterabufferedoperationiscomplete,itisimportanttoclearthebufferbycallingtheClearBufferVI.Otherwise,thememoryallocatedforthebufferintheonboardRAMisnotavailableforotheruses,suchastheallocationofanotherbuffer.Buffersmustonlybeclearedwhennomotorsaremovingandnoprogramsarerunning.
Abuffercannotbereconfiguredorclearedwhilethebufferisinuse.TheVIgeneratesaBufferInUseerrorinsuchacase.
Abuffercanonlybeusedbyoneresourceatatime.Multipleresourcescanbeassociatedwithasinglebuffer,butonlyoneresourcecanusethatbufferatanygiventime.Likewise,asingleresourcecanmakeuseofmanybuffers,butforbuffersofthesametype,onlyoneofthemcanbeassociatedwiththatresourceatagiventime.RefertotheNI73xxControllerConsiderationssectionofthisVIdescriptionformoreinformation.
NoteConfiguringandclearingbuffersisaprocessor-intensiveoperationontheNImotioncontrollerthatrequirestheallocationandde-allocationofmemory.Configureandclearbuffersonlywhenmotorsarenotmovingandonboardprogramsarenotrunning.
ExampleUses
General-PurposeInputandGeneral-PurposeOutputExamples
Configurea300-pointoutputbufferandfillitwithposition,velocity,andaccelerationvaluesforasequenceof100moves.Thenwriteanonboard
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NI73xxControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwitha73xxmotioncontroller:
UsinginputvectorsandreturnvectorswiththeReadBufferandWriteBufferVIs,youcanwritetoandreadfromthebufferwithdatastoredinonboardvariables.Youmustlimitthenumberofpointstoreadorwritebecausethereareonly120onboardvariables.DataisreadfromorwrittentoonboardvariablessequentiallystartingatthevariablespecifiedbyInpVectorRetVectintheWriteBufferVIorReadBufferVI,respectively.
SpecifyaBufferSizeof0toassociatearesource(likeanaxisorvectorspace)toanexistingbuffer,withoutaffectingthesizeofthebufferorthedatacontainedinthebuffer.Thefollowingexamplesillustratetheuseofthistechnique:
Asingleresource,forexample,anaxisorvectorspace,canusebuffer1foracontouringoperation,andthenswitchtobuffer2forasubsequentoperation.Youcansetupthetwobuffersaheadoftime,andwhenthefirstoperationiscomplete,youcanmakeanadditionalcalltoConfigureBufferwithaBufferSizeof0,thesamevalueforResource,andthenewbuffernumberforBuffer.Ifyouwishtoreuseabufferwithanotherresource,simplycalltheConfigureBufferVIwiththesamebuffernumber,aBufferSizeof0,andanewvalueforResource.Bothresourcescanstillusethesinglebuffer,butnotatthesametime.
ABufferSizeof0allowsyoutoassociatearesourcewithanexistingbuffer,withoutchangingthecontentsoftheexistingbuffer.Also,aBufferSizeof0canbeusedtoleavethecurrentbufferalone,butchangethevalueofanotherparameter.Whenyoureconfigurethe
ReadBufferReadsdatafromapreviouslyconfiguredbuffer.
Details
DeviceCompatibility
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.Bufferisthebuffertoconfigure.Validbuffernumbersare1through255(0x01through0xFF).RetVectindicatesthedestinationforthereturndatageneratedbythisVI.Availablereturnvectorsincludereturndatatothehost(0xFF),returndatatoavariable(0x01through0x78)orvariablearray(0x81through0xF8),anddonotreturndata(0).RefertoInputandReturnVectorsformoredetailedinformation.
WhenreturningdatatoRetVect,youmustlimitNumberofPointstoanumberthatfitsinasequenceofonboardvariablesstartingwiththevariablespecifiedbyRetVect.
errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,or
UsingThisVI
Aninputbuffercanbewrittentoafterithasbeenconfigured,usuallybyanonboardprogram.Afterdataisavailable,youreadthedatafromthebufferwiththeReadBufferVI.
Whenthebufferisconfiguredforasingleiteration,youcanwaituntilthebufferisfullbycheckingitsstatususingtheCheckBufferVI,andthenreadtheentirecontentsofthebuffer.Youalsocanreadsmallerchunksofdatafromthebufferwhiletheoperationisinprogress.ThenumberofpointsavailabletoreadcanbedeterminedwiththeBacklogparameterreturnedbyCheckBuffer.
Whenusingthebufferasacircularbuffer(TotalPoints>BufferSize)withOldDataStopturnedon,youmustreaddatafromthebufferfasterthanthebufferisfilledwithnewdata.YoucandeterminethenumberofpointsyoucansafelyreadfromthebufferbycallingtheCheckBufferVI.
TheBacklogparametertellsyouhowmanypointsyoucansafelyreadfromthebuffer.
Ifyoutrytoreaddatathathasnotyetbeenwrittentothebufferbythecontroller,thedataisnotread,andthecontrollergeneratesanOldDataStoperror.IfyouconfigurethebufferwithOldDataStopsettofalse,however,youcanreaddatafreelyfromthebuffer,andthecontrollerdoesnotenforcetheOldDataStopcondition.
ReadBuffergeneratesanillegalbufferoperationerrorifyoutrytoreaddatafromanoutputbufferafterthespecifiednumberofpoints(TotalPoints)hasalreadybeenreadfromthebuffer.
WriteBufferWritesdatatoapreviouslyconfiguredbuffer.
Details
DeviceCompatibility
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.Bufferisthebuffertoconfigure.Validbuffernumbersare1through255(0x01through0xFF).InpVectindicatesthesourceofthedataforthisVI.Availableinputvectorsincludeimmediate(0xFF),variable(0x01through0x78),orindirectvariable(0x81through0xF8).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroora
UsingThisVI
Afterabufferhasbeenconfiguredforanoutputoperationsuchascontouring,youmustwritedatatothebufferbeforestartingtheoperation.Whenallofthedatafitsinthebuffer(BufferSize TotalPoints),youneedonlyfillthebufferonetimewiththeappropriatedata.
Whenusingthebufferasacircularbuffer(TotalPoints>BufferSize),withOldDataStopturnedon,youneedtowritefreshdatatothebufferfasterthanthemotioncontrollerconsumesthedata.Afterfillingthebufferonce,andstartingthebufferedoperation,youcandeterminethenumberofpointsyoucansafelywritetothebufferbycallingtheCheckBufferVI.TheBacklogparametertellsyouhowmanypointsyoucansafelywritetothebufferwithoutoverwritingdatathathasyettobeconsumedbythecontroller.
Ifyoutrytowritenewdataontopofolddata,whichisdatathathasnotbeenconsumedbythecontroller,thewritecommanddoesnotexecute,andthecontrollergeneratesanOldDataStoperror.IfyouconfigurethebufferwithOldDataStopsettofalse,however,thecontrollerdoesnotenforcetheOldDataStopconditionandyoucanwritedatafreelytothebuffer.
ExampleUses
BasicUses
Supposeyouhaveacontourmoveof25,107points,andconfigureabufferwithBufferSizeof1,000pointsandTotalPointsof25,107.YousetOldDataStopintheConfigureBufferVItoTrue,andusetheCheckBufferandWriteBufferVIsasyouwritedatatothebufferinsmallchunkswhilethedataisconsumedbythemotioncontroller.Whenyouwritethelastpointstothecontroller,youcanstillsetRegenerationModeto0(nochange)andthemotioncontrollerknowsyouaredonewritingdatatothebufferbecauseyouhavewritten25,107pointsintotal.Whenthecontrollerisunabletoreadanymorebecausethereadmarkhascaughtuptothewritemark,thecontrollerchecksRegenerationMode,recognizesthisstopisintentionalbecausethetotalpointswrittentothebufferisequaltoTotalPoints,andcompletestheoperationwithoutgenerating
Start&StopMotionVIsYoucanuseStart&StopMotionVIstostart,blend,andstopmotion.
YoucanexecutealloftheNI-MotionstartandstopVIsonanindividualaxis,simultaneouslyonmultipleaxes,onavectorspace,orsimultaneouslyonmultiplevectorspaces.TheseVIsgivecompletecontroloverthestateofthemotorsinthesystemandwiththeadditionoftheFindReferenceVIs,aretheonlyNI-MotionVIsthatcanactuallyinitiatemotion.
ClicktheiconsforVIdescriptions.
StartMotion
BlendMotion
StopMotion
BlendMotionBlendsmotiononasingleaxis,singlevectorspace,multipleaxes,ormultiplevectorspaces.
Details
DeviceCompatibility
Axis/VSMapisthebitmapofaxesorvectorspacestoblend.ItisonlyrequiredwhenyouselectmultipleaxesorvectorspaceswiththeAxisorVectorSpaceparameter.
Whenblendingaxes(AxisorVectorSpace=0):
Axis/VS1—Iftrue,blendaxis.Iffalse,donotblendaxis.Axis/VS2—Iftrue,blendaxis.Iffalse,donotblendaxis.Axis/VS3—Iftrue,blendaxis.Iffalse,donotblendaxis.Axis/VS4—Iftrue,blendaxis.Iffalse,donotblendaxis.Axis/VS5—Iftrue,blendaxis.Iffalse,donotblendaxis.Axis/VS6—Iftrue,blendaxis.Iffalse,donotblendaxis.Axis/VS7—Iftrue,blendaxis.Iffalse,donotblendaxis.Axis/VS8—Iftrue,blendaxis.Iffalse,donotblendaxis.
Whenblendingvectorspaces(AxisorVectorSpace=0x10):
Axis/VS1—Iftrue,blendvectorspace.Iffalse,donotblendvectorspace.Axis/VS2—Iftrue,blendvectorspace.Iffalse,donotblendvectorspace.
UsingThisVI
TheprimarydifferencebetweenaStartMotionVIandaBlendMotionVIisthattheStartMotionVIisimmediateandpreemptive,whiletheBlendMotionwaitsandstartsthenextmoveuponthecompletionofthepreviousmove.
TheBlendMotionVIisusedtoblendmotionprofilesonaxesorvectorspaces,eithersimultaneouslyorindividually.AblendissimilartoanormalstartandhasthesamerequirementsforvalidtrajectoryparametersastheStartMotionVI.Theblendedmoveusesthemostrecentlyloadedvaluesofacceleration,velocity,targetposition,s-curve,operationmodeandsoontogeneratethemotionprofile.
NoteIfastepperaxisisinakilledstate(notenergized),halttheaxisusingtheStopMotionVI,withStopTypesettohaltstop,beforeyouexecuteaStartMotionorBlendMotionVI.Afteryouhalttheaxis,youmightneedtowaitbeforeexecutingaStartMotionorBlendMotionVI,sothatthestepperdrivecomesoutofresetstate.IfthestepperdrivedoesnotcomeoutofresetstatebeforeyouexecutetheVI,thestepperaxismightlosesomestepsduringacceleration.TodeterminewhetheryouneedtowaitbeforeexecutingtheVI,refertothestepperdrivedocumentationorvendor.
Blendstartingsmoothlyblendstwomovesegmentsonanaxis,axes,orvectorspace(s).Therearethreetypesofblends,controlledbytheblendfactor:
Blendmovesbysuperimposingthedecelerationprofileofthepreviousmovewiththeaccelerationprofileofthenextmove(blendfactor=–1).Blendmovesbystartingthenextmoveattheexactpointwhenthepreviousmovehasstopped(blendfactor=0).Startthenextmoveafteraprogrammeddelaytimebetweentheendofthepreviousmoveandthestartofthenextmove(blendfactor>0ms).
RefertotheLoadBlendFactorVIformoreinformationabouthowblendfactorcontrolstheblendingofmotionprofiles.
StartMotionStartsmotiononasingleaxis,singlevectorspace,multipleaxes,ormultiplevectorspaces.
Details
DeviceCompatibility
Axis/VSMapisthebitmapofaxesorvectorspaces(coordinatespaces)towaiton.ItisonlyrequiredwhenmultipleaxesorvectorspacesareselectedwiththeAxisorVectorSpaceparameter.
Whenstartingaxes(AxisorVectorSpace=0):
Axis/VSMap1—Iftrue,startaxis.Iffalse,donotstartaxis.Axis/VSMap2—Iftrue,startaxis.Iffalse,donotstartaxis.Axis/VSMap3—Iftrue,startaxis.Iffalse,donotstartaxis.Axis/VSMap4—Iftrue,startaxis.Iffalse,donotstartaxis.Axis/VSMap5—Iftrue,startaxis.Iffalse,donotstartaxis.Axis/VSMap6—Iftrue,startaxis.Iffalse,donotstartaxis.Axis/VSMap7—Iftrue,startaxis.Iffalse,donotstartaxis.Axis/VSMap8—Iftrue,startaxis.Iffalse,donotstartaxis.
Whenstartingvectorspaces(AxisorVectorSpace=0x10):
Axis/VSMap1—Iftrue,startvectorspace.Iffalse,donotstartvectorspace.Axis/VSMap2—Iftrue,startvectorspace.Iffalse,donotstartvectorspace.
UsingThisVI
TheStartMotionVIisusedtostartamotionprofileonaxesorvectorspaces,eithersimultaneouslyorindividually.Astartispreemptiveandusesthemostrecentlyloadedvaluesofacceleration,velocity,targetposition,s-curve,operationmode,andsoontogeneratethemotionprofile.
NoteIfastepperaxisisinakilledstate(notenergized),halttheaxisusingthebeforeyouexecuteaStartMotionorBlendMotionVI.Afteryouhalttheaxis,youmightneedtowaitbeforeexecutingaStartMotionorBlendMotionVI,sothatthestepperdrivecomesoutofresetstate.IfthestepperdrivedoesnotcomeoutofresetstatebeforeyouexecutetheVI,thestepperaxismightlosesomestepsduringacceleration.TodeterminewhetheryouneedtowaitbeforeexecutingtheVI,refertothestepperdrivedocumentationorvendor.
YoualsocanusetheStartMotionVItoupdatetrajectoryparameterstoamovethatisalreadyinprocess.Trajectoryparametersloadedafterthestarttakeeffectimmediatelyuponthenextstartwithoutrequiringthemotiontocometoastop.Youcanusethisfeatureforvelocityprofilingandothercontinuousmotionapplications.Theexecutionofapreemptivestartdependsontheparametersentered,thetypeofmove,andthecontroller.Refertothefollowingtableformoreinformation.
MoveType ControllerType SameDirection
SingleAxisMove73xxController Movestartsimmediately1
NISoftMotionController Movestartsimmediately
VectorSpaceMove73xxController Motiondeceleratestoastop,thenstartsNISoftMotionController Movestartsimmediately
1Inmostcases,themovestartsimmediately.However,ifthenewtargetpositionisclosertothecurrentpositionthantheprevioustargetposition,themovedeceleratestoastop,thenstarts.Refertothefiguresbelowformoreinformation.
2Thetimerequiredtostartthenextmovedependsonthedecelerationtime.Ifthedecelerationtimeisveryslow,thenextmovemaytakelongerthanexpectedtostart.
ThefirstimagedemonstratesthecasewhereStartMotioniscalledwithanewtargetpositiononthesamesideoftheoriginaltargetpositionasthecurrentposition.Inthiscase,motiondeceleratestoastop,thenstartsagain.ThesecondimagedemonstratesthecasewhereStartMotioniscalledwithanewtargetpositionontheoppositesideoftheoriginaltargetpositionasthecurrentposition.Inthiscase,themovecontinuestothenewtargetpositionwithoutstopping.
TheStartMotionVIisusedtostartamotionprofileonaxesorvectorspaces,eithersimultaneouslyorindividually.Astartispreemptiveandusesthemostrecentlyloadedvaluesofacceleration,velocity,targetposition,s-curve,operationmode,andsoontogeneratethe
Ifastepperaxisisinakilledstate(notenergized),halttheaxisusingtheStopMotionVI,withStopTypesettohaltstop,VI.Afteryouhalttheaxis,youmightneedtowaitbeforeexecutingaStart
MotionorBlendMotionVI,sothatthestepperdrivecomesoutofresetstate.IfthestepperdrivedoesnotcomeoutofresetstatebeforeyouexecutetheVI,thestepperaxismightlosesomestepsduringacceleration.TodeterminewhetheryouneedtowaitbeforeexecutingtheVI,refertothestepperdrivedocumentationorvendor.
YoualsocanusetheStartMotionVItoupdatetrajectoryparameterstoamovethatisalreadyinprocess.Trajectoryparametersloadedafterthestarttakeeffectimmediatelyuponthenextstartwithoutrequiringthemotiontocometoastop.Youcanusethisfeatureforvelocityprofilingandothercontinuousmotionapplications.Theexecutionofapreemptivestartdependsontheparametersentered,thetypeofmove,andthecontroller.Refertothefollowingtableformoreinformation.
SameDirection OppositeDirectionMovestartsimmediately1 Motiondeceleratestoastop,thenstarts2
Movestartsimmediately Motiondeceleratestoastop,thenstarts2
Motiondeceleratestoastop,thenstarts2 Motiondeceleratestoastop,thenstarts2
Movestartsimmediately Motiondeceleratestoastop,thenstarts2
Inmostcases,themovestartsimmediately.However,ifthenewtargetpositionisclosertothecurrentpositionthantheprevioustargetposition,themovedeceleratestoastop,thenstarts.Refertothefiguresbelowformoreinformation.
Thetimerequiredtostartthenextmovedependsonthedecelerationtime.Ifthedecelerationtimeisveryslow,thenextmovemaytake
ThefirstimagedemonstratesthecasewhereStartMotioniscalledwithanewtargetpositiononthesamesideoftheoriginaltargetpositionasthecurrentposition.Inthiscase,motiondeceleratestoastop,thenstartsagain.ThesecondimagedemonstratesthecasewhereStartMotioniscalledwithanewtargetpositionontheoppositesideoftheoriginaltargetpositionasthecurrentposition.Inthiscase,themovecontinuestothenewtargetpositionwithoutstopping.
StopMotionStopsmotiononasingleaxis,singlevectorspace,multipleaxes,ormultiplevectorspaces.
Threetypesofstopscanbeexecuted:
DeceleratetostopHaltstopKillstop
DetailsRemarks
DeviceCompatibility
StopType(Decel)isthetypeofstoptoexecute,asfollows.
Value Definition0 Decelerate1 Halt2 KillAxis/VSMapisthebitmapofaxesorvectorspacestostop.ItisonlyrequiredwhenmultipleaxesorvectorspacesareselectedwiththeAxisorVectorSpaceparameter.NI-Motionignoresadditionalaxesforcontrollersthatoperatelessthaneightaxes.
Whenstoppingaxes(AxisorVectorSpace=0):
Axis/VSMap1—Iftrue,stopaxis.Iffalse,donotstopaxis.
UsingThisVI
ThisVIisusedtostopamotionprofileonaxesorvectorspaces,eithersimultaneouslyorindividually.YoucanexecutethreedifferenttypesofstopswiththeStopMotionVI:deceleratestop,haltstop,andkillstop.
DecelerateStop
Whenadeceleratestopisexecuted(deceleratetostop),theaxis,axes,orvectorspace(s)immediatelybegintofollowthedecelerationportionoftheirtrajectoryprofileascontrolledbypreviouslyloadeddecelerationands-curveparameters.Theactualstoppedpositionisthereforedependentuponthisdecelerationtrajectory.
HaltStop
Incontrast,ahaltstophasthefollowingbehaviordependingonthestateoftheaxis:
Iftheaxisisnotmovingandnotenergized,theaxisisenergized.Iftheaxisisnotmovingandenergized,callingahaltstophasnoeffect.Iftheaxisismoving:
Onservoaxes,fulltorqueisappliedtostopthemotor(s)assoonasthecommandisreceivedbythemotioncontroller.Onstepperaxes,thesteppulsesareceasedasquicklyaspossible.However,itispossiblethattheremaybeasmallamountoffollowingerrorafterhaltingthemove.Thisfollowingerrorwillbecompensatedforwithapull-inmoveduringthenextmove.
Inbothcases,NI-Motionattemptstostopthemotor(s)withanearinfiniterateofdeceleration.ThereisnotrajectoryprofileandmotionisnotcontrolledbypreviouslyloadeddecelerationandS-curveparameters.
NoteForstepperaxesconfiguredforp-commandmode,ensurethattheaxisisnotmovingbeforehaltinganaxisthatwaspreviouslykilledtoavoidpositionerrorbetweenthecontrollerandthedrive.Inthiscase,acalltohaltstopwhiletheaxisismovingresetsyourreferencepositiontoanundefinedlocation,andyoushouldperformaexecutinganothermove.
KillStop
Onservoaxes,akillstopdisablesthecontrolloopandzerostheoutputDAC,allowingfrictionalforcesalonetostopthemotion.Onstepperaxes,akillstopceasesthestepperpulsegenerationassoonasthecommandisreceivedbythemotioncontroller.Onbothaxistypes,thereisnotrajectoryprofileduringakillstop.Ifenabled,theinhibitoutputisactivatedtoinhibit(disable)theservoamplifierorstepperdrive.Youcanenabletheinhibitoutputsandsettheirpolaritytoactivehighoractivelowwiththe
ThisVIisusedtostopamotionprofileonaxesorvectorspaces,eithersimultaneouslyorindividually.YoucanexecutethreedifferenttypesofstopswiththeStopMotionVI:deceleratestop,haltstop,andkillstop.
Whenadeceleratestopisexecuted(deceleratetostop),theaxis,axes,orvectorspace(s)immediatelybegintofollowthedecelerationportionoftheirtrajectoryprofileascontrolledbypreviouslyloadeddecelerationands-curveparameters.Theactualstoppedpositionis
Incontrast,ahaltstophasthefollowingbehaviordependingonthestateoftheaxis:
Iftheaxisisnotmovingandnotenergized,theaxisisenergized.Iftheaxisisnotmovingandenergized,callingahaltstophasnoeffect.
Onservoaxes,fulltorqueisappliedtostopthemotor(s)assoonasthecommandisreceivedbythemotioncontroller.Onstepperaxes,thesteppulsesareceasedasquicklyaspossible.However,itispossiblethattheremaybeasmallamountoffollowingerrorafterhaltingthemove.Thisfollowingerrorwillbecompensatedforwithapull-inmoveduringthenextmove.
Inbothcases,NI-Motionattemptstostopthemotor(s)withanearinfiniterateofdeceleration.ThereisnotrajectoryprofileandmotionisnotcontrolledbypreviouslyloadeddecelerationandS-curveparameters.
Forstepperaxesconfiguredforp-commandmode,ensurethattheaxisisnotmovingbeforehaltinganaxisthatwaspreviouslykilledtoavoidpositionerrorbetweenthecontrollerandthedrive.Inthiscase,acalltohaltstopwhiletheaxisismovingresetsyourreferencepositiontoanundefinedlocation,andyoushouldperformaFindHomereferencemovebefore
Onservoaxes,akillstopdisablesthecontrolloopandzerostheoutputDAC,allowingfrictionalforcesalonetostopthemotion.Onstepperaxes,akillstopceasesthestepperpulsegenerationassoonasthecommandisreceivedbythemotioncontroller.Onbothaxistypes,thereisnotrajectoryprofileduringakillstop.Ifenabled,theinhibitoutputisactivatedtoinhibit(disable)theservoamplifierorstepperdrive.YoucanenabletheinhibitoutputsandsettheirpolaritytoactivehighoractivelowwiththeConfigureInhibitOutputsVI.
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NI73xxControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwitha73xxmotioncontroller:
Ifanaxisthatispartofavectorspaceisindividuallykilled,theotheraxesinthevectorspacearedeceleratedtostop.Ifaprogramattemptstostartaxesthathavebeenmanuallystoppedbythehostcomputer,itisoverruledandputintothepausedstate.
NISoftMotionControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwiththeNISoftMotionController:
Ifanaxisthatispartofavectorspaceisindividuallykilled,theotheraxesinthevectorspacearealsokilled.YoucanexecutethisVIonlyonanaxisthatisenabled.
MotionI/OVIsYoucanuseMotionI/OVIstosetupandcontrolthemotionI/OfeaturesoftheNImotioncontroller.MotionI/OVIsincludeVIstosetpolarityandenablelimitandhomeinputs,high-speedcaptureinputsandinhibitoutputs,VIstoconfigureandcontrolbreakpointoutputs,andVIstoreadthestatusofallthemotionI/Osignals,high-speedcapturedposition,andsoftwarelimitstatus.
AllofthededicatedmotionI/Oalsocanfunctionasgeneral-purposedigitalI/Owhentheyarenotbeingusedfortheirmotionspecificfeatures.Youcansetandresetoutputs,youcanreadinputsatanytime,andyoucansetandchangetheirpolarityasrequired.
MotionI/OVIsincludelimitsandotherbasicMotionI/OVIs,BreakpointVIs,andHigh-SpeedCaptureVIs.
ClicktheiconsforVIdescriptions.
EnableLimits SetHomeInputPolarityReadLimitStatus ConfigureDriveSignalSetLimitInputPolarity ReadDriveSignalStatusLoadSoftwareLimitPositions ConfigureInhibitOutputsEnableHomeInputs SetInhibitMOMOReadHomeInputStatus
Subpalettes
BreakpointVIs
High-SpeedCaptureVIs
ConfigureDriveSignalConfiguresthedrivesignal.
Details
DeviceCompatibility
Pinisthespecificbit(0to7)intheportspecifiedbyport.FortheHSCport,trigger1=pin0,trigger2=pin1,trigger3=pin2,trigger4=pin3,trigger5=pin4,trigger6=pin5,trigger7=pin6,andtrigger8=pin7.PortisthegeneralpurposeI/Oport(1to8)orHSCsoftwareport(10)tocontrol.BoardIDisauniquenumberassignedbyMAXusedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.Axisistheaxistoconfigure.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroora
UsingThisVI
UsethisVItoconfigureandreserveI/Olinestoreceivesignalsfromthedrive.Thefollowingdrivesignalsareavailable:In-PositionandDriveFault(ServoAlarm).
TipUseConfigureMotionI/OMapinsteadofthisVIforadditionaldrivesignalsupport.
UsetheIn-Positiondrivesignalwhenthedriveiscontrollingaservomotorandtheinputtothedriveisstep/direction.Thissignaltellsthemotioncontrollerwhenthedriveconsidersthemotortobeatthecommandedposition.
WhentheIn-Positiondrivesignalisconfigured,theMoveCompletestatusislinkedtothestateoftheIn-Positionsignal.ThemoveisnotconsideredcompleteunlesstheIn-Positionsignalisactive.
NoteRefertoWriteTrajectoryDatatoaddorremovethissignalfromthemovecompletecriteria.
UsetheDriveFaultdrivesignaltoconnectaservoalarmsignaltothemotioncontrollersothatwhenanalarmorotherdrivefaultoccurs,themotionisstoppedusingakillstop.AkillstopdisablesthecontrolloopandzeroestheDACsothatfrictionalforcesstopthemotion.
ConfigureInhibitOutputsSetspolarityandenablestheper-axisinhibitoutputs.
DetailsRemarks
DeviceCompatibility
Enableenables/disablesinhibitoutputontheselectedaxis.DriveModespecifieseitherOpenCollector(default)orTotemPolemode.DriveModeisavailableonlyontheNI7350andisnotconfigurableonNI7330/40/90motioncontrollers.BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.Axisistheaxistoconfigure.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroora
UsingThisVI
TheConfigureInhibitOutputsVIenables/disablestheinhibitoutputs,setsthePolarity(activeloworactivehigh)oftheaxisinhibitoutputs,andsetstheDriveMode.Whenenabled,aper-axisinhibitoutputislinkedtothemotoroffstateofthecorrespondingaxis.Akilledaxis(motoroff)forcesthecorrespondinginhibitoutputOn.Whentheaxisisactive,theinhibitoutputisOff.Noticethatthisisthelogicalstate.Theactualstatedependsonthepolarityofthesystem.
Inhibitoutputsaretypicallyusedtodisabletheservoamplifierorstepperdriveforpowersaving,safety,orspecificapplicationreasons.
FormoreinformationaboutOpenCollectorandTotemPoledrivemodes,refertotheNI7350HardwareUserManual.ConfiguringDriveModeissupportedonlyon7350controllersandisnotconfigurableonNI7330/40/90motioncontrollers.
NoteKillingaservoaxisalsozerositsDACoutput.Withtorqueblockamplifiers,thismeansthatthemotorfreewheelsregardlessofwhethertheamplifierisdisabled.Withvelocityblockservoamplifiersorstepperdrives,themotordoesnotfreewheelunlesstheamplifier/driveisdisabledwiththeinhibitoutput.
Youalsocanuseinhibitoutputsasgeneral-purposeoutputs.DisabledinhibitoutputsignorethestateoftheircorrespondingaxisandcanbedirectlycontrolledthroughtheSetInhibitMOMOVI.
Youcanconfigurethepolarityofeachinhibitoutputasactiveloworactivehigh.Whenconfiguredasactivelow,theoutputisactivewhenthereisalowsignalontheoutputpin.Conversely,activehighmeansthattheoutputisactivewhenthereisahighsignalontheoutputpin.Theinhibitpolarityisalwaysineffect,whethertheinhibitislinkedtoitsaxis(enabled)ordirectlycontrolledthroughtheSetInhibitMOMOVI.
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NI73xxControllerConsiderations
ThefollowingincludesconsiderationsyoumustmakewhenyouareusingthisVIwitha73xxmotioncontroller:
ThePCI-7390doesnotsupportthePolarityparameter.TosettheactivestateonaPCI-7390useWriteDigitalI/OData.
EnableHomeInputsEnables/disablesthehomeinputs.
Details
DeviceCompatibility
Homes(Disabled)isthebitmapofhomeinputstoenable:Axis1—Iftrue,homeinputisenabled.Iffalse,homeinputisdisabled(default).Axis2—Iftrue,homeinputisenabled.Iffalse,homeinputisdisabled(default).Axis3—Iftrue,homeinputisenabled.Iffalse,homeinputisdisabled(default).Axis4—Iftrue,homeinputisenabled.Iffalse,homeinputisdisabled(default).Axis5—Iftrue,homeinputisenabled.Iffalse,homeinputisdisabled(default).Axis6—Iftrue,homeinputisenabled.Iffalse,homeinputisdisabled(default).Axis7—Iftrue,homeinputisenabled.Iffalse,homeinputisdisabled(default).Axis8—Iftrue,homeinputisenabled.Iffalse,homeinputisdisabled(default).
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.
UsingThisVI
TheEnableHomeInputsVIenables/disablesanycombinationofaxishomeinputs.Anenabledhomeinputcausesahaltstopontheaxiswhentheinputbecomesactive.YoucanconfigureeachhomeinputasactiveloworactivehighwiththeSetHomeInputPolarityVI.Youalsocanuseahomeinputasageneral-purposeinputandreaditsstatuswiththeReadHomeInputStatusVI.
HomeinputsareanenhancementontheNImotioncontrollerandarenotrequiredforbasicmotioncontrol.YoucanoperateallmotioncontrolVIswithoutenablingorusingthehomeinputsexcepttheFindReferenceVI,whichrequiresenabledlimitandhomeinputsforoperationwhentheFindReferencetypeis"home."
ToconfigurethepropertyofFindReferenceHome,suchasInitialsearchdirectionandHomeedgetostopon,usetheLoadReferenceParameterVI.
NoteAnactiveandenabledhomeinputtransitiononanaxisthatispartofavectorspacemovecausesthataxistohaltstopandtheotheraxesinthevectorspacetodeceleratetoastop.
Example
Toenablethehomeinputsforaxes2and4,calltheEnableHomeInputsVIwithHomes,asfollows.
Home1 Home2 Home3 Home4 Home5 Home6 Home7 Home8False True False True False False False False
EnableLimitsEnables/disableseithertheforwardandreverselimitinputsortheforwardandreversesoftwarepositionlimits.
DetailsRemarks
DeviceCompatibility
LimitType(LimitInputs)selectsthetypeoflimittoenable,eitherthehardwarelimitswitchinputsorthesoftwarepositionlimits,asfollows.
Value Definition0 Limitinputs1 SoftwarelimitsBoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,
UsingThisVI
TheEnableLimitsVIenables/disablesanycombinationofaxislimits.Youcanenablethephysicallimitinputs(hardware)orthelogicalpositionlimits(software)dependingupontheLimitTypeselected.Youcanenableordisableforwardandreverselimitsseparately.Toenablebothsoftwareandhardwarelimitsonanaxisoraxes,callthisVItwice.
Thelimitinputsaretypicallyconnectedtoend-of-travellimitswitchesorsensors.Anenabledlimitinputcausesahaltstopontheaxiswhentheinputbecomesactive.YoucanconfigureeachlimitinputasactiveloworactivehighwiththeSetLimitInputPolarityActivelimitinputsalsoprohibitattemptstostartmotionthatwouldcauseadditionaltravelinthedirectionofthelimit.Youalsocanuselimitinputsasgeneral-purposeinputsandreadtheirstatuswiththeReadLimitStatusVI.
NoteFortheend-of-travellimitstofunctioncorrectly,theforwardlimitswitchorsensormustbelocatedatthepositive(countup)endoftravelandthereverselimitatthenegative(countdown)endoftravel.
Similarly,softwarelimitsareoftenusedtorestricttherangeoftravelfurtherandavoideverhittingthehardwarelimitswitches.Anenabledsoftwarelimitcausestheaxistosmoothlydeceleratetoastopwhenthelimitpositionisreachedorexceeded.Toenablethesoftwarelimits,youmustfirstfindthereferencepointusingtheFindReferenceVI.
Evenwhendisabled,youcanusethehostcomputertopollthesoftwarelimitstowarnofanout-of-rangeposition.RefertotheLoadSoftwareLimitPositionsandtheReadLimitStatusVIsforinformationaboutloadingandreadingtheforwardandreversesoftwarelimits.
HardwarelimitinputsandsoftwarepositionlimitsareenhancementsontheNImotioncontrollerandarenotrequiredforbasicmotioncontrol.YoucanoperateallmotioncontrolVIswithoutenablingorusingtheselimitsexcepttheFindReferenceVI,whichrequiresenabledlimitandhomeinputsforoperation.RefertothefollowingVIsformoreinformationaboutenablinghomeinputs:SetHomeInputPolarity,EnableHomeInputsandReadHomeInputStatus.
Example
UsingThisVI
TheEnableLimitsVIenables/disablesanycombinationofaxislimits.Youcanenablethephysicallimitinputs(hardware)orthelogicalpositionlimits(software)dependingupontheLimitTypeselected.Youcanenableordisableforwardandreverselimitsseparately.Toenablebothsoftwareandhardwarelimitsonanaxisoraxes,callthisVItwice.
Thelimitinputsaretypicallyconnectedtoend-of-travellimitswitchesorsensors.Anenabledlimitinputcausesahaltstopontheaxiswhentheinputbecomesactive.YoucanconfigureeachlimitinputasactiveloworactivehighwiththeSetLimitInputPolarityVI.Activelimitinputsalsoprohibitattemptstostartmotionthatwouldcauseadditionaltravelinthedirectionofthelimit.Youalsocanuselimitinputsasgeneral-purposeinputsandreadtheirstatuswiththeReadLimitStatusVI.
Fortheend-of-travellimitstofunctioncorrectly,theforwardlimitswitchorsensormustbelocatedatthepositive(countup)endoftravelandthereverselimitatthenegative(countdown)endoftravel.
Similarly,softwarelimitsareoftenusedtorestricttherangeoftravelfurtherandavoideverhittingthehardwarelimitswitches.Anenabledsoftwarelimitcausestheaxistosmoothlydeceleratetoastopwhenthelimitpositionisreachedorexceeded.Toenablethesoftwarelimits,youmustfirstfindthereferencepointusingtheFindReferenceVI.
Evenwhendisabled,youcanusethehostcomputertopollthesoftwarelimitstowarnofanout-of-rangeposition.RefertotheLoadSoftwareLimitPositionsandtheReadLimitStatusVIsforinformationaboutloadingandreadingtheforwardandreversesoftwarelimits.
HardwarelimitinputsandsoftwarepositionlimitsareenhancementsontheNImotioncontrollerandarenotrequiredforbasicmotioncontrol.YoucanoperateallmotioncontrolVIswithoutenablingorusingtheselimitsexcepttheFindReferenceVI,whichrequiresenabledlimitandhomeinputsforoperation.RefertothefollowingVIsformoreinformationaboutenablinghomeinputs:SetHomeInputPolarity,EnableHomeInputs,
ReadHomeInputStatus.
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NI73xxControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwitha73xxmotioncontroller:
Anactive(andenabled)limitinputtransitiononanaxisthatispartofavectorspacemovecausesthataxistohaltstopandtheotheraxesinthevectorspacetodeceleratetoastop.Ifanyaxisinavectorspacemoveexceedsanenabledsoftwarelimitposition,allaxesinthevectorspacedeceleratetoastop.
NISoftMotionControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwiththeNISoftMotionController:
Anactive(andenabled)limitonanaxisthatispartofavectorspacecausesalloftheaxesinthevectorspacetohaltstop.
LoadSoftwareLimitPositionsLoadstheforwardandreversesoftwarelimitpositionsforanaxis.
Details
DeviceCompatibility
ReverseSWLimitisthereversesoftwarelimitpositionincounts(servoaxes)orsteps(stepperaxes).Softwarelimitpositionscanbeanywherewithinthe32-bitpositionrange,–(231)to+(231–1).Thedefaultvalueforthereversesoftwarelimitis–(230)counts(steps).
NoteTheForwardSWLimitcannotbelessthantheReverseSWLimit.
ForwardSWLimitistheforwardsoftwarelimitpositionincounts(servoaxes)orsteps(stepperaxes).Softwarelimitpositionscanbeanywherewithinthe32-bitpositionrange,–(231)to+(231–1).Thedefaultvaluefortheforwardsoftwarelimitis+(230)–1counts(steps).BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.Axisistheaxistocontrol.InpVectindicatesthesourceofthedataforthisVI.Availableinputvectorsincludeimmediate(0xFF),variable(0x01through0x78),orindirectvariable(0x81through0xF8).RefertoInputandReturnVectorsformoredetailedinformation.
UsingThisVI
TheLoadSoftwareLimitPositionsVIsetstheforwardandreversepositionlimitvaluesfortheselectedaxis.WhenenabledwiththeEnableLimitsVI,asoftwarelimitcausestheaxistosmoothlydeceleratetoastopwhenthelimitpositionisreachedorexceeded.
Evenwhendisabled,youcanpollthesoftwarelimitsbythehostcomputeroruseanonboardprogramtowarnofanoutofrangeposition.RefertotheReadLimitStatusVIforinformationaboutreadingthesoftwarelimitstatus.
Theforwardsoftwarelimitisconsideredactiveifthecurrentpositionisgreaterthanorequaltotheforwardsoftwarelimitposition.Thereversesoftwarelimitisconsideredactiveifthecurrentpositionislessthanorequaltothereversesoftwarelimitposition.
Softwarelimitsareoftenusedtorestricttherangeoftravelandavoidhittingthehardwareend-of-travellimitswitches.Forexample,youcantravelatahighvelocityuntilhittingthesoftwarelimitswitch,andthenmovemoreslowlyuntilhittingthehardwarelimitswitch.
CautionAfteranaxishasstoppedduetoencounteringasoftwarelimitswitch,youcanstillmovefurtherinthesamedirectionifyoucommandtheaxistodoso.Thisbehaviorisnotpossiblewithhardwarelimits,butisappropriateforsoftwarelimits.NoteIfyouaredoingonboardprogrammingandareusingInpVecttogetthedatathisVIneeds,rememberthatthisVIreadsthevariablesstartingatthememoryaddresspointedtobyInpVectinthefollowingorder:ForwardSWLimit,ReverseSWLimit.
ReadDriveSignalStatusReturnsthestatusofthedrivesignalwhenanactivesignalisdetected.
Details
DeviceCompatibility
BoardIDisauniquenumberassignedbyMAXusedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.Axisistheaxistoconfigure.RetVectisthedestinationforthereturndata.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.UsetheerrorhandlerVIstolookupthemeaningofthiscodeanddisplaythecorrespondingerrormessage.sourceisastringthatindicatestheoriginoftheerror,ifany.Typically,sourceisthenameoftheVIinwhichtheerroroccurred.
UsingThisVI
UsethisVItoreadthestatusofthedrivesignalwhenanactivedrivesignalisdetected.IfIn-Positionisactive,bit0=True.IfDriveFaultisactive,bit1=True.
TipUseReadMotionI/ODatainsteadofthisVIformoreoptions.
ReadEncoderPositionReadsthepositionofanencoder.
Details
DeviceCompatibility
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.AxisorEncoderistheaxisorencodertoread.RetnVectindicatesthedestinationforthereturndatageneratedbythisVI.Availablereturnvectorsincludereturndatatothehost(0xFF),toavariable(0x01through0x78),toanindirectvariable(0x81through0xF8),anddonotreturndata(0).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroora
UsingThisVI
TheReadEncoderPositionVIreturnsthequadraturecountvalueoftheencoderselected.Theencodermustbeenabled,eitherdirectlythroughtheEnableEncodersVIorautomatically,bybeingmappedtoanenabledaxis.
TheReadEncoderPositionVIistypicallyusedtoreadthevalueofanencoderthatisnotpartofanaxis.Thisencodercouldbeamasterencoderusedformaster-slavegearingoranindependentpositionorvelocitysensor.
Forreadingencodersmappedtoaxes,youcancallthisVIontheaxisordirectlyonitsmappedencoder.Forservoaxes,bothapproachesreturnthesamevalueastheReadPositionVI.Onstepperaxeshowever,thisVIcanreturnadditionalusefulinformation.
Duringaxissetup,youcanoperatetheclosed-loopstepperaxisinopen-loopmodeandusethisVItodirectlymeasurethecountsperrevolutionandstepsperrevolutionfortheaxis.Thesevaluesmustbeloadedinadvanceforsubsequentclosed-loopoperation.RefertotheLoadCounts/StepsperRevolutionVIformoreinformation.
YoualsocanusethisVItoreturnafinerreadingofpositionincaseswheretheencoderresolutiongreatlyexceedsthestepresolutionoftheclosed-loopstepperaxis.
ReadHomeInputStatusReadstheinstantaneousstatusofthehomeinputs.
Details
DeviceCompatibility
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.RetVectindicatesthedestinationforthereturndatageneratedbythisVI.Availablereturnvectorsincludereturndatatothehost(0xFF),returndatatoavariable(0x01through0x78),returndatatoanindirectvariable(0x81through0xF8),anddonotreturndata(0).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.UsetheerrorhandlerVIstolookupthemeaningof
UsingThisVI
TheReadHomeInputStatusVIreturnsthelogicalstateofthehomeinputs.YoucanexecutethisVIatanytimetomonitorthehomeinputs,whethertheyareenabledornot.AhomeinputenabledwiththeEnableHomeInputsVIcausesahaltstoponanaxiswhenitshomeinputbecomesactive(True).Youalsocanuseahomeinputasageneral-purposeinputandreaditsstatuswiththisVI.ThehomeinputstatusduringaFindReferencemoveisundefined.
Todeterminethehomefoundstatus,useReadReferenceStatusandsetthereferencetypeto"home".
NoteThisVIreturnsundefinedvaluesforaxesthatarecurrentlyperformingfindreferencemoves.NoteThisVIreadsthelogicalstate(OnorOff,TrueorFalse)ofthehomeinputs.ThepolarityofthehomeinputsdetermineswhetheranOnstateisactivehighoractivelow.RefertotheSetHomeInputPolarityVIformoreinformation.
ReadLimitStatusReadstheinstantaneousstateofeitherthehardwarelimitinputsorthesoftwarelimits.
Details
DeviceCompatibility
LimitType(LimitInputs)selectsthetypeoflimitstatustoread,eitherthehardwarelimitswitchinputsorthesoftwarepositionlimits,asfollows.
Value Definition0 Limitinputs1 SoftwarelimitsBoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.RetVectcontainsthereverselimitsandforwardlimits,whicharereturnedinoneonboardvariable:0000000FFFFFFFF00000000RRRRRRRR0.
Availablereturnvectorsincludereturndatatothehost(0xFF),returndatatoavariable(0x01through0x78),returndatatoanindirectvariable(0x81through0xF8),anddonotreturndata(0).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralready
UsingThisVI
TheReadLimitStatusVIreturnseitherthehardwarelimitinputstatusorthesoftwarepositionlimitstatus,dependingonthelimittypeselected.WhenLimitType=LimitInputs(0),thisVIreturnsthelogicalstateoftheforwardandreverselimitinputs.
NoteThisVIreturnsundefinedvaluesforaxesthatarecurrentlyperformingfindreferencemoves.NoteThepolarityofthelimitinputsdetermineswhetheranOnstateisactivehighoractivelow.RefertotheSetLimitInputPolarityVIformoreinformation.
Alternatively,whenLimitType=SoftwareLimits(1),thisVIreturnsthestateoftheforwardandreversesoftwarelimits.ATrue(On)indicatesthattheforwardorreverselimitpositionforthecorrespondingaxishasbeenreachedorexceeded.ThelimitstatusduringaFindReferencemoveisundefined.
Youcanreadthestatusofthelimitinputsandthesoftwarepositionlimitsatanytime,whetherthelimitsareenabledornot.EnabledlimitscauseaxestostopwhentheirstatetransitionsTrue.RefertotheEnableLimitsVIformoreinformation.
NoteIfyouaredoingonboardprogrammingandareusingRetnVecttowritedata,thisVIwritesthevariablesstartingatthememoryaddresspointedtobyRetnVectinthefollowingorder:ForwardLimits,ReverseLimits.
SetHomeInputPolaritySetsthepolarityofthehomeinputsaseitheractivelow/activeopenoractivehigh/activeclosed.
Details
DeviceCompatibility
HomePolarityisthebitmapofactivepolaritiesforthehomeinputs:Axis1—IfTRUE,activelow/activeopen(default).IfFALSE,activehigh/activeclosed.Axis2—IfTRUE,activelow/activeopen(default).IfFALSE,activehigh/activeclosed.Axis3—IfTRUE,activelow/activeopen(default).IfFALSE,activehigh/activeclosed.Axis4—IfTRUE,activelow/activeopen(default).IfFALSE,activehigh/activeclosed.Axis5—IfTRUE,activelow/activeopen(default).IfFALSE,activehigh/activeclosed.Axis6—IfTRUE,activelow/activeopen(default).IfFALSE,activehigh/activeclosed.Axis7—IfTRUE,activelow/activeopen(default).IfFALSE,activehigh/activeclosed.Axis8—IfTRUE,activelow/activeopen(default).IfFALSE,activehigh/activeclosed.
BoardIDisauniquenumberassignedbyMeasurement&Automation
UsingThisVI
TheSetHomeInputPolarityVIdefinestheactivestateforeachhomeinputaseitheractivelow/activeopenoractivehigh/activeclosed.
Whenconfiguredasactivelow,theinputisactivewhenthereisalowsignalontheinputpin.Conversely,activehighmeansthattheinputisactivewhenthereisahighsignalontheinputpin.
Configuringanactivestateofactiveopenoractivecloseddoesnotcorrespondtothelevelofthesignalontheinputpin.Instead,anactiveopenstatemeansthattheinputisactivewhencurrentisnotflowingthroughtheoptocoupledinput.Conversely,anactiveclosedstatemeansthattheinputisactivewhencurrentisflowingthroughtheoptocoupledinput.
YoucanenablehomeinputstocausehaltstopswhentheinputbecomesactivewiththeEnableHomeInputsVI.Youalsocanuseahomeinputasageneral-purposeinputandreaditsstatuswiththeReadHomeInputStatusVI.
Tofindthehomeinputreferenceonasystem,useFindReferenceandconfigurethesearchtypeas"home".
Example
Tosettheactivestateofthehomeinputsonaxes1,3and4asactivelowandtherestofthehomeinputsasactivehigh,calltheSetHomeInputPolarityVIwithHomePolarityasfollows.
Home1 Home2 Home3 Home4 Home5 Home6 Home7 Home8True False True True False False False False
SetInhibitMOMOSetstheinhibitoutputsusingtheMustOn/MustOffprotocol.
Details
DeviceCompatibility
MustOff(False)isthebitmapofinhibitoutputstoforceoff:InhibitOutput1—Iftrue,inhibitoutputforcedoff.Iffalse,inhibitoutputunchanged(default).InhibitOutput2—Iftrue,inhibitoutputforcedoff.Iffalse,inhibitoutputunchanged(default).InhibitOutput3—Iftrue,inhibitoutputforcedoff.Iffalse,inhibitoutputunchanged(default).InhibitOutput4—Iftrue,inhibitoutputforcedoff.Iffalse,inhibitoutputunchanged(default).InhibitOutput5—Iftrue,inhibitoutputforcedoff.Iffalse,inhibitoutputunchanged(default).InhibitOutput6—Iftrue,inhibitoutputforcedoff.Iffalse,inhibitoutputunchanged(default).InhibitOutput7—Iftrue,inhibitoutputforcedoff.Iffalse,inhibitoutputunchanged(default).InhibitOutput8—Iftrue,inhibitoutputforcedoff.Iffalse,inhibitoutputunchanged(default).
MustOn(False)isthebitmapofinhibitoutputstoforceon:InhibitOutput1—Iftrue,inhibitoutputforcedon.Iffalse,inhibit
UsingThisVI
TheSetInhibitMOMOVIcontrolsdisabledinhibitoutputsbeingusedasgeneral-purposeoutputs.YoucandirectlysettheinhibitoutputstoalogicalOnorOffstate.
NoteThisVIhasnoeffectonenabledinhibitoutputs.Theseoutputsaredirectlycontrolledbytheircorrespondingaxes.
UsingtheMustOn/MustOffprotocolallowsyoutosetorresetindividualinhibitoutputswithoutaffectingtheotherinhibitoutputs.Thisgivesyoutri-statecontrolovereachoutput:On,Off,orUnchanged.ATrueinalocationoftheMustOnbitmapturnstheinhibitOn,whileaTrueinthecorrespondinglocationoftheMustOffbitmapturnstheinhibitOff.AFalseineitherbitmaphasnoaffect,soleavingboththeMustOnandMustOffatFalseiseffectivelyahold,andthestateoftheinhibitoutputisunchanged.IfyousetboththeMustOnandMustOffbitstoTrue,itisinterpretedasaMustOnconditionandtheinhibitisturnedOn.
MustOn–>MustOff 1 0
1 On Off0 On Unchanged
NoteThisVIsetsthelogicalstateofaninhibitoutputOnorOff(TrueorFalse).ThepolarityoftheinhibitoutputsdeterminewhetheranOnstateisactivehighoractivelow.RefertotheConfigureInhibitOutputsVIformoreinformation.
TheSetInhibitMOMOVIallowsindividualcontroloftheinhibitoutputswithoutrequiringashadowvaluetorememberthestateofotheroutputsnotbeingsetorresetwiththeVI.
Example
Toturninhibitoutput1On,output4off,andleavetheotherinhibitoutputsunchanged,calltheSetInhibitMOMOVIwiththefollowingparameters:
MustOncorrespondstothefollowing:
MustOn1 MustOn2 MustOn3 MustOn4 MustOn5 MustOn6 MustOn7
UsingThisVI
TheSetInhibitMOMOVIcontrolsdisabledinhibitoutputsbeingusedasgeneral-purposeoutputs.YoucandirectlysettheinhibitoutputstoalogicalOnorOffstate.
ThisVIhasnoeffectonenabledinhibitoutputs.Theseoutputsaredirectlycontrolledbytheircorrespondingaxes.
UsingtheMustOn/MustOffprotocolallowsyoutosetorresetindividualinhibitoutputswithoutaffectingtheotherinhibitoutputs.Thisgivesyoutri-statecontrolovereachoutput:On,Off,orUnchanged.ATrueinalocationoftheMustOnbitmapturnstheinhibitOn,whileaTrueinthecorrespondinglocationoftheMustOffbitmapturnstheinhibitOff.AFalseineitherbitmaphasnoaffect,soleavingboththeMustOnandMustOffatFalseiseffectivelyahold,andthestateoftheinhibitoutputisunchanged.IfyousetboththeMustOnandMustOffbitstoTrue,itis
MustOnconditionandtheinhibitisturnedOn.
1 0
On OffOn Unchanged
ThisVIsetsthelogicalstateofaninhibitoutputOnorOff(TrueorFalse).ThepolarityoftheinhibitoutputsdeterminewhetheranOnstateisactivehighoractivelow.
ConfigureInhibitOutputsVIformoreinformation.
TheSetInhibitMOMOVIallowsindividualcontroloftheinhibitoutputswithoutrequiringashadowvaluetorememberthestateofotheroutputsnotbeingsetorresetwiththeVI.
Toturninhibitoutput1On,output4off,andleavetheotherinhibitoutputsunchanged,calltheSetInhibitMOMOVIwiththefollowingparameters:
correspondstothefollowing:
MustOn2 MustOn3 MustOn4 MustOn5 MustOn6 MustOn7 MustOn8
SetLimitInputPolaritySetsthepolarityoftheforwardandreverselimitinputsaseitheractivelow/activeopenoractivehigh/activeclosed.
Details
DeviceCompatibility
ReverseLimitPolarityisthebitmapofactivepolaritiesforthereverselimitinputs:
Axis1—IfTRUE(default),activelow/activeopen.IfFALSE,activehigh/activeclosed.Axis2—IfTRUE(default),activelow/activeopen.IfFALSE,activehigh/activeclosed.Axis3—IfTRUE(default),activelow/activeopen.IfFALSE,activehigh/activeclosed.Axis4—IfTRUE(default),activelow/activeopen.IfFALSE,activehigh/activeclosed.Axis5—IfTRUE(default),activelow/activeopen.IfFALSE,activehigh/activeclosed.Axis6—IfTRUE(default),activelow/activeopen.IfFALSE,activehigh/activeclosed.Axis7—IfTRUE(default),activelow/activeopen.IfFALSE,activehigh/activeclosed.Axis8—IfTRUE(default),activelow/activeopen.IfFALSE,active
UsingThisVI
TheSetLimitInputPolarityVIdefinestheactivestateforeachforwardandreverselimitinputaseitheractivelow/activeopenoractivehigh/activeclosed.
Whenconfiguredasactivelow,theinputisactivewhenthereisalowsignalontheinputpin.Conversely,activehighmeansthattheinputisactivewhenthereisahighsignalontheinputpin.
Configuringanactivestateofactiveopenoractivecloseddoesnotcorrespondtothelevelofthesignalontheinputpin.Instead,anactiveopenstatemeansthattheinputisactivewhencurrentisnotflowingthroughtheoptocoupledinput.Conversely,anactiveclosedstatemeansthattheinputisactivewhencurrentisflowingthroughtheoptocoupledinput.
YoucanenablelimitinputstocausehaltstopswhentheinputbecomesactivewiththeEnableLimitsVI.Youalsocanusealimitinputasageneral-purposeinputandreaditsstatuswiththeReadLimitStatusVI.
Example
Tosettheactivestateoftheforwardandreverselimitinputsonaxes1,2,3,and4asactivelowandtheforwardandreverselimitinputsontheremainingaxesasactivehigh,calltheSetLimitInputPolarityVIwiththefollowingparameters:
ForwardLimitPolaritycorrespondstothefollowing.
Forward1
Forward2
Forward3
Forward4
Forward5
Forward6
Forward7
Forward8
True True True True False False False False
ReverseLimitPolaritycorrespondstothefollowing.
Reverse1
Reverse2
Reverse3
Reverse4
Reverse5
Reverse6
Reverse7
Reverse8
BreakpointVIsPositionbreakpointsareanenhancementtotheencoderdecodersontheNImotioncontrollerandareavailablewhentheencodersoperateasaxisfeedbackorasindependentencoderresources.Breakpointfunctionalityisavailableonservoandclosed-loopstepperaxes.YoucanuseBreakpointVIstoconfigure,enable,andreadthepositionbreakpointstatus.AdvancedVIs,suchasperiodicbreakpointandbufferedbreakpointcanbeusedtoachievehigher-frequencybreakpoints.Toconfigurebuffersforbufferedbreakpoints,refertoBufferVIs.Youalsocanloadabreakpointpositionmodulus.LikeallmotionI/O,breakpointoutputsalsocanfunctionasgeneral-purposeoutputswiththeSetBreakpointOutputMOMOVI.
NoteAllbreakpointscanbeaffectedbyjitterinthemotionsystem.Forexample,ifyouhavebreakpointpositionsveryclosetoeachother,thejitterinthemotionsystemcouldcausethepositiontochangeenoughtoreachthebreakpointwhenabreakpointisnotintended.IncreasethevalueofthebreakpointwindowusingSetu32tocompensateforsystemjitter.
Refertothefollowingtableforthemaximumbreakpointratesforeachtypeofbreakpoint.Notallbreakpointsareavailableonallcontrollers.
BreakpointType MaximumFrequencySingle 150HzBuffered,PIDrateof62.5µsto250µs 2kHz
Buffered,PIDrategreaterthan250µs 1kHz
Periodic 4MHz
ClicktheiconsforVIdescriptions.
ConfigureBreakpoint
LoadBreakpointPosition
EnableBreakpointOutput
ReadBreakpointStatus
ConfigureBreakpointOutput
SetBreakpointOutputMOMO
LoadBreakpointModulus
ConfigureBreakpointConfiguresapositionbreakpointonanaxisorencoder.
Details
DeviceCompatibility
Operation(Single)selectsbetweensingleandbufferedbreakpointoperation.ValidvaluesareSINGLEandBUFFEREDoperation.BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.AxisorEncoderistheaxisorencodertocontrol.YoucanloadBreakpointPositiononencodersmappedtoaxes1through8ordirectlyonencoders0x21through0x28.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroora
UsingThisVI
TheConfigureBreakpointVIconfiguresthebreakpointtotheappropriatemode,operation,andaction.Italsodefinestheactiontoperformwhenthebreakpointisreached—leavethebreakpointoutputunchanged,resetthebreakpointoutputtolow,setthebreakpointoutputtohigh,ortogglethestateofbreakpointoutput.RefertotheSynchronizationsectionoftheNI-MotionHelpformoreinformationaboutthetypesofbreakpointsyoucanconfigure.
NoteFormodulobreakpoints,themagnitudeofthebreakpointvaluemustbelessthanthebreakpointmodulus.Ifthisrangeisexceeded,amodalerrorisgeneratedwhenyouexecutetheEnableBreakpointOutputVI.
Enablemodedetermineshowthepreviouslyloadedbreakpointpositionisinterpreted.Absolutebreakpointscanbeanywhereinthe32-bitpositionrange.Relativebreakpointsarerelativetotheinstantaneousencoderpositionwhenthebreakpointisenabled.Modulobreakpointsareinterpretedwithintherangeoftheloadedbreakpointmodulus.Formoreinformationaboutmodulobreakpoints,refertotheLoadBreakpointModulusVI.
Whenanenabledbreakpointisreached,abreakpointeventoccurs.YoucanusetheReadBreakpointStatusVItoseeifabreakpointhasoccurred.
Abreakpointeventalsocancausethestateofthecorrespondingbreakpointoutputtochange.ActionOnBreakpointselectswhethertheoutputgoeslow,goeshigh,togglesstate,ordoesnotchangewhenthebreakpointeventoccurs.IfthebreakpointoutputispresentlyinthestatedefinedbyActionOnBreakpoint,itisforcedtotheoppositestatewhenthebreakpointisenabled.Thisguaranteesthattheappropriatetransitionoccurswhenthebreakpointisreached.
NoteNI-Motiondoesnotsupportbreakpointandhigh-speedcapturefunctionalityonanaxiswhentheprimaryfeedbackforthataxisisusedasanalogfeedback.
Absolute
ConfigureBreakpointOutputConfiguresthedrivemodeandpolarityofthebreakpointoutput.
DeviceCompatibility
Details
DriveModespecifieseitherOpenCollectororTotemPolemode.BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.AxisorEncoderistheaxisorencodertoconfigure.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroora
UsingThisVI
UsetheConfigureBreakpointOutputVItoconfiguretheDriveModeandPolarityofthebreakpointsignal.CallthisVIatthebeginningoftheapplicationbeforeenablingthebreakpointwiththeEnableBreakpointOutputVI.
FormoreinformationaboutOpenCollectorandTotemPoledrivemodes,refertothedocumentationforyour7350device.ConfiguringDriveModeissupportedonlyon7350controllers.
Youcanconfigurebreakpointoutputasactiveloworactivehigh.Whenconfiguredasactivelow,theoutputisactivewhenthereisalowsignalontheoutputpin.Conversely,activehighmeansthattheoutputisactivewhenthereisahighsignalontheoutputpin.
EnableBreakpointOutputEnablesapositionbreakpointonanaxisorencoder.
Details
DeviceCompatibility
EnableBreakpointindicateswhethertoenableordisablethebreakpointoutput.ValuesareTrueorFalse.BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.AxisorEncoderistheaxisorencodertocontrol.YoucanloadBreakpointPositiononencodersmappedtoaxes1through6ordirectlyonencoders0x21through0x24.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,
UsingThisVI
ThisVIenablesordisablesthebreakpointwithconfigurationsetbytheConfigureBreakpointVI.Forsinglebreakpoints,youmustre-enableifyouwantanotherbreakpoint.Bufferedandperiodicbreakpointsonlyneedtobeenabledonce.Whenanenabledbreakpointisreached,abreakpointeventoccurs.YoucanusetheReadBreakpointStatusVItoseeifabreakpointhasoccurred.
Youcanenableonlyonebreakpointperencoderoraxisatatime.Whenanenabledbreakpointisreached,thebreakpointisautomaticallydisabled.Youmustexplicitlyre-enablethebreakpointtouseitagain.Ifyouneedtodisableapreviouslyenabledbreakpoint,runthisVIwithEnableBreakpointsettoFalse.
NoteEnabledbreakpointsarealsoautomaticallydisabledwhenyouexecuteaResetPositionorResetEncoderPositionVIonthecorrespondingaxis.
Breakpointsarefullyfunctionalonindependentencodersthatarenotmappedtoaxes.Inthiscase,youenablebreakpointsdirectlyontheencoderresource.
NoteIfyouusemodulusbreakpointsorenablethesamebreakpointrepeatedlyatlowvelocity(<50counts/sec),youmaygetabreakpointoutputimmediatelyafteryoure-enableit,becausethepositionmaynothavechangedfromthelastbreakpoint.
Toavoidthisproblem,useMAXortheSetu32VItochangethebreakpointwindow.Thebreakpointwindowisabufferaroundthebreakpointpositioninwhichabreakpointisnotenabledwhilethecurrentpositionremainsinsidethebuffer.NoteAllbreakpointscanbeaffectedbyjitterinthemotionsystem.Forexample,ifyouhavebreakpointpositionsveryclosetoeachother,thejitterinthemotionsystemcouldcausethepositiontochangeenoughtoreachthebreakpointwhenabreakpointisnotintended.IncreasethevalueofthebreakpointwindowusingSetu32tocompensateforsystemjitter.
LoadBreakpointModulusLoadthebreakpointmodulusforapositionbreakpoint.
Details
DeviceCompatibility
BreakpointModulus(0)istheperiod,forperiodicbreakpoints,orthemodulus,formodulusbreakpoints.Therangeforperiodis1to215–1.Therangeformodulusis0to231–1.Amodulusvalueof0makesamodulusbreakpointbehavethesameasanabsolutebreakpointon7330/40/90controllers.BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.AxisorEncoderistheaxisorencodertocontrol.YoucanloadBreakpointPositiononencodersmappedtoaxes1through6ordirectlyonencoders0x21through0x24.InpVectindicatesthesourceofthedataforthisVI.Availableinputvectorsincludeimmediate(0xFF),variable(0x01through0x78),orindirectvariable(0x81through0xF8).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassesthe
UsingThisVI
ThisVIloadsapositionmodulus/period,dependingonthebreakpointmode.Thisvalueisdouble-bufferedinthecontrolleranddoesnottakeeffectuntilyouexecutetheEnableBreakpointOutputVI.
Modulobreakpointsareusedinapplicationsthatrequirerepetitive,equallyspacedbreakpoints.Whenusingabreakpointmodulus,itisnolongernecessarytoloadeverincreasing(ordecreasing)breakpointpositions.Itisstillnecessary,however,tore-enablethebreakpointaftereachuse.
NoteForclosed-loopsteppersystemsinwhichtheencodercounts-per-revolutiondiffersfromthesteps-per-revolution,thebreakpointpositionisloadedinencodercounts.
Whenyouenableamodulobreakpoint,twobreakpointpositions,oneinfrontandonebehindthepresentencoderposition,areenabled.
NoteIfyouusemodulusbreakpointorenablethesamebreakpointrepeatedlyatlowvelocity(<50counts/sec),youmaygetabreakpointoutputimmediatelyafteryoure-enableit,becausethebreakpointisre-enabledbeforeyouhavemovedfromthepreviousbreakpointposition.
Toavoidthisproblem,useMAXortheSetu32VItochangethebreakpointwindow.Thebreakpointwindowisabufferaroundthebreakpointpositioninwhichabreakpointisnotenabledwhilethecurrentpositionremainsinsidethebuffer.
Example
Anapplicationrequiresbreakpointsevery2,000countsoffsetat-500counts:...–4,500,–2,500,–500,1,500,3,500,andsoon.Toaccomplishthis,youloadabreakpointpositionof-500withtheLoadBreakpointPositionVIandabreakpointmodulusof2,000.Iftheinstantaneousencoderpositionis2,210countswhenyouexecutetheEnableBreakpointOutputVI(inmodulomode),
LoadBreakpointPositionLoadsthebreakpointpositionforanaxisorencoderincounts.
Details
DeviceCompatibility
BreakpointPosition(0)isthebreakpointpositioninquadraturecounts.Breakpointpositionscanbeanywherewithinthe32-bitpositionrange,–(231)to+(231)–1.Thedefaultvalueiszero(0).BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.AxisorEncoderistheaxisorencodertocontrol.YoucanloadBreakpointPositiononencodersmappedtoaxes1through8ordirectlyonencoders0x21through0x28.InpVectindicatesthesourceofthedataforthisVI.Availableinputvectorsincludeimmediate(0xFF),variable(0x01through0x78),orindirectvariable(0x81through0xF8).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
UsingThisVI
TheLoadBreakpointPositionVIloadsthebreakpointpositionvaluefortheaxisorencoderspecified.Thebreakpointpositionisinterpreteddifferentlydependingonthebreakpointmodeandtheencoderpositionwhenthebreakpointisenabled.Youcanspecifypositionbreakpointsaseitherabsolute,relative,orwithrespecttoamodulusrangewhenthebreakpointisenabled.Breakpointpositionisdouble-bufferedandnotactuallyuseduntilyouexecutetheEnableBreakpointOutputVI.
NoteFormodulobreakpoints,themagnitudeofthebreakpointvaluemustbelessthanthebreakpointmodulus.Ifthisrangeisexceeded,amodalerrorisgeneratedwhenyouexecutetheEnableBreakpointOutputVI.NoteToloadbreakpointpositionsforbufferedbreakpoints,refertotheWriteBufferVI.TheLoadBreakpointPositionVIdoesnothaveanyaffectonbufferedbreakpoints.
Whenthebreakpointpositionisreached,abreakpointeventisgeneratedandtheassociatedhigh-speedbreakpointoutputimmediatelytransitions.
High-speedbreakpointfunctionalityisperformedbytheencoderresourcesthemselves.WhenthisVIissenttoanaxis,itisactuallybeingsenttothemappedencoderresource.
Whenthesamebreakpointpositionisusedonarepetitivebasis,itisnotnecessarytoreloadthepositioneachtime.Itisnecessary,however,tore-enablethebreakpointaftereachuse.
NoteForclosed-loopsteppersystemsinwhichtheencodercounts-per-revolutiondiffersfromthesteps-per-revolution,thecapturedpositionisinencodercounts.
ReadBreakpointStatusReadsthebreakpointstatusforallaxesorencoders.
NoteYoucannotusethisVItoreadthestatusofbufferedbreakpoints.UseCheckBuffertogetthestatusofthebuffer.
Details
DeviceCompatibility
BreakpointType(Position)isareservedinputthatmustbesettoPositionBreakpoint(0).BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.AxisorEncoderistheaxiscontrolorencodercontrolselector.Formulti-axisstatus,use0(zero).Formulti-encoderstatus,use0x20.RetVectindicatesthedestinationforthereturndatageneratedbythisVI.Availablereturnvectorsincludereturndatatothehost(0xFF),returndatatoavariable(0x01through0x78),returndatatoanindirectvariable(0x81through0xF8),anddonotreturndata(0).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralready
UsingThisVI
ThisVIallowsyoutoseeifabreakpointhasoccurredorispending.Whenyouenableabreakpoint,thecorrespondingstatusbitisresettoindicatethatthebreakpointispending.Forsinglebreakpoints,thisstatusissetwhenabreakpointoccurs.Periodicbreakpointsonlysetthebreakpointstatusafterthefirstbreakpointhasoccurred,andthestatusremainsassertedacrossthesubsequentbreakpoints.Whenthebreakpointpositionisreached,itsstatusbitissettoTrue(1).
Example
ExecutingtheReadBreakpointStatusVIwithAxisorEncoder=0x20andBreakpointType=0returnsBreakpointStatus,whichcorrespondstothefollowingbitmap.
Axis/Encoder1
Axis/Encoder2
Axis/Encoder3
Axis/Encoder4
Axis/Encoder5
Axis/Encoder6
Axis/Encoder7
Axis/Encoder8
True False False True False False False False
Onencoders1and4,breakpointshaveoccurred,butonencoders2and3,breakpointsarependingorwereneverenabled.
NoteReadBreakpointsStatusreturnsthebreakpointstatusforeitherallaxesorallencoders,basedonwhichvalueispassedintoAxisorEncoder.
SetBreakpointOutputMOMOSetsthebreakpointoutputsusingtheMustOn/MustOffprotocol.
Details
DeviceCompatibility
MustOffisthebitmapofbreakpointoutputstoforceOff:1—Iftrue,breakpointoutputisforcedOff.Iffalse,breakpointoutputisunchanged(default).2—Iftrue,breakpointoutputisforcedOff.Iffalse,breakpointoutputisunchanged(default).3—Iftrue,breakpointoutputisforcedOff.Iffalse,breakpointoutputisunchanged(default).4—Iftrue,breakpointoutputisforcedOff.Iffalse,breakpointoutputisunchanged(default).5—Iftrue,breakpointoutputisforcedOff.Iffalse,breakpointoutputisunchanged(default).6—Iftrue,breakpointoutputisforcedOff.Iffalse,breakpointoutputisunchanged(default).7—Iftrue,breakpointoutputisforcedOff.Iffalse,breakpointoutputisunchanged(default).8—Iftrue,breakpointoutputisforcedOff.Iffalse,breakpointoutputisunchanged(default).
MustOnisthebitmapofbreakpointoutputstoforceOn:
UsingThisVI
TheSetBreakpointOutputMOMOVIdirectlycontrolsthebreakpointoutputsandsetsthemhighorlow.YoucanusethisVItosetbreakpointoutputstoaknownstateortocontrolthemasgeneral-purposeoutputsinnon-breakpointapplications.YoucanonlycontroltheoutputusingthisVIifthebreakpointisdisabled.
NoteTheSetBreakpointOutputMOMOVIonlyaffectstheoutputstateofthebreakpoint.Itdoesnotchangethebreakpointstatus.
Breakpointfunctionalityisperformedbytheencoderresourcesthemselves.WhenthisVIissenttoaxes,theNI-Motionfirmwareconsultsthemappingofaxestoencodersandactuallysendsthecommandtothemappedencoderresources.Breakpointsareonlyavailableonencoderresources.RefertoEncodersforencoderresourceIDs.
UsingtheMustOn/MustOffprotocolallowsyoutosetorresetindividualbreakpointoutputswithoutaffectingtheotherbreakpointoutputs.Thisgivesyoutri-statecontrolovereachoutput:On,Off,orUnchanged.ATrueinalocationoftheMustOnbitmapsetsthebreakpointhigh,whileaTrueinthecorrespondinglocationoftheMustOffbitmapresetsthebreakpointlow.AFalseineitherbitmaphasnoeffect,soleavingboththeMustOnandMustOffbitsatzeroiseffectivelyahold,andthestateofthebreakpointoutputisunchanged.IfyousetboththeMustOnandMustOffbitstoTrue,itisinterpretedasaMustOnconditionandthebreakpointissethigh.
NoteIfthebreakpointisenabledusingtheEnableBreakpointOutputVI,youcannotchangetheoutputvalueusingSetBreakpointOutputMOMO.Thecommandisignoredbythemotioncontroller.NoteThefirstinputvectorsourceindicatesthevaluefortheMustOninputandthesecondvectorsourceindicatesthevaluefortheMustOffinput.Itisnotabitmapofthebreakpointoutput.
IfyouaredoingonboardprogrammingandareusingInpVecttogetthedatathisVIneeds,rememberthatthisVIreadsthevariablesstartingatthe
High-SpeedCaptureVIsHigh-speedcaptureinputsareanenhancementtotheencoderFPGAandareavailablewhentheencodersareoperatingasaxisfeedbackorasindependentencoderresources.High-speedcapturefunctionalityisavailableonservoandclosed-loopstepperaxes.
YoucanuseHigh-SpeedCaptureVIstoconfigure,enable,andreadthestatusofhigh-speedinputs.Bufferedhigh-speedcaptureisalsoavailableontheNI-7350motioncontrollers.Bufferedcaptureisamoreadvanceduseofhigh-speedcapturewherethecapturedpositionsarestoredinapreviously-configuredbuffer.Thishelpsthehigh-speedcaptureperformathighercapturefrequencies.RefertotheBufferedOperationsOverviewfordetailsonbufferoperationsinbufferedhigh-speedcaptureforthe7350controller.
Thehigh-speedcaptureinputsalsocanfunctionaslatchinggeneral-purposeinputs.Configuretheinputsasyouwouldforhigh-speedcaptureoperation,butignorethecapturedposition.Youcanthenreadthestateofthelatchedinputs.
ClicktheiconsforVIdescriptions.
ConfigureHigh-SpeedCapture
EnableHigh-SpeedCapture
ReadCapturedPosition
ReadHigh-SpeedCaptureStatus
ConfigureHigh-SpeedCaptureConfiguresthehigh-speedcaptureinputfortheappropriatesignalbehavior.
DetailsRemarks
DeviceCompatibility
Operation(Single)selectsbetweensingleandbufferedhigh-speedcapture.CaptureModeselectsamongthefollowingvaluestospecifythemannerinwhichtheincominghigh-speedcapturesignalisinterpreted:Non-InvertingLevelInvertingLevelLow-to-HighEdgeHigh-to-LowEdgeNon-InvertingDigitalInputInvertingDigitalInput
Non-InvertingLevel,InvertingLevel,Low-to-HighEdge,andHigh-to-LowEdgemodesdefinethestateoftheinputsignalthatresultsinahigh-speedcaptureevent.Non-InvertingLevelmeansthatanactivehighinputcausesacapturetooccur.Conversely,InvertingLevelmeansthatanactivelowinputcausesacapturetooccur.Noticethatifthesignalisalreadyatthespecifiedlevelwhenhigh-speedcaptureisenabled,the
UsingThisVI
Afterconfiguringthehigh-speedcaptureinput,youenablethehigh-speedcapturecircuitrywiththeEnableHigh-SpeedCaptureVI.TheReadHigh-SpeedCaptureStatusVItellsyouwhenthecaptureeventhasoccurred.Finally,youreadthecapturedvaluewiththeReadCapturedPositionVI.
High-speedcaptureinputsareanintegralpartoftheencoderresources.YoucanexecutethisVIindirectlyonaxesordirectlyonencoderresources.
Thecontrollercapturestheinstantaneousencoderpositionwhentheinputbecomesactive,asdefinedintheCaptureModeparameter.
High-speedcapturefunctionalityisavailableinbothsingleandbufferedmode.Insinglehigh-speedcapture,theinputtriggerisconfiguredtocaptureasingleencoderposition,andmustbere-enabledaftereachcapture.Youcanusebufferedhigh-speedcapturetosupporthighercapturefrequencies.Bufferedhigh-speedcaptureallowscapturespositionstobestoredintoabufferandautomaticallyre-enabledbythecontroller.Toconfigureabufferforhigh-speedcapture,refertotheConfigureBufferVI.
Youcanuseahigh-speedcaptureinputasageneral-purposeinputandreaditsstatuswiththeReadHigh-SpeedCaptureStatusVI.InNon-InvertingLevel,InvertingLevel,Low-to-HighEdge,andHigh-to-LowEdgemodes,theinputhaslatchingbehavior,meaningthatafterthehigh-speedcaptureinputisenabled,iftheinputsignaleverbecomesactive(asdefinedbytheCaptureModeparameter),thehigh-speedcapturestatusistrueuntiltheinputisreenabled.InNon-InvertingDigitalInputandInvertingDigitalInputmodes,theinputssimplyreflectthecurrentstateoftheinputsignal.Theinputdoesnotneedtobeenabledorreenabledatanytimeinthesemodes.
NoteNI-Motiondoesnotsupportbreakpointandhigh-speedcapturefunctionalityonanaxiswhentheprimaryfeedbackforthataxisisusedasanalogfeedback.NoteWhenconfiguredasadigitalinput,EnableHigh-SpeedCaptureandReadCapturedPositionhavenoeffect.Thehigh-speedcaptureinputis
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NI73xxControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwitha73xxmotioncontroller:
YoucansynchronizeNI73xxmotioncontrollerswithotherNationalInstrumentsdevicesusingtheRTSIbus.RefertotheSelectSignalVIforinformationaboutusingtheRTSIbusasthehigh-speedcapturetrigger.NI73xxcontrollersdonotsupportmultiplesimultaneoushigh-speedcapturesperaxis.
NISoftMotionControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwiththeNISoftMotionController:
TheNISoftMotionControllersupportsmultiplesimultaneoushigh-speedcapturesperaxis.
TousethisVItoconfiguretheNISoftMotionControllerformultiplehigh-speedcapturesonanaxis,settheupperfourbitsoftheresourceIDtothefollowing.
Type ValuePrimaryHSCapture 0X0SecondaryHSCapture 0XA0
Forexample,toconfigureprimaryhigh-speedcaptureonaxis1,settheresourceIDto0X01.Toconfiguresecondaryhigh-speedcaptureonaxis
EnableHigh-SpeedCaptureEnablesordisablesthespecifiedhigh-speedcaptureinput.
DetailsRemarks
DeviceCompatibility
High-SpeedCaptureindicateswhethertoenableordisablethehigh-speedcaptureinput.ValuesareTrueorFalse.BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.AxisorEncoderistheaxisorencoderselector.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.UsetheerrorhandlerVIstolookupthemeaningofthiscodeanddisplaythecorrespondingerrormessage.sourceisastringthatindicatestheoriginoftheerror,ifany.
UsingThisVI
TheEnableHigh-SpeedCaptureVIenableshigh-speedcaptureinputstocaptureinstantaneousencoderpositionwhenaninputbecomesactive.Thepositioncaptureisimplementedintheencoderresourcetoreducecapturelatencytothesub-100nanosecondrange.
NoteIfyourapplicationusestheSelectSignalVItoroutethehigh-speedcapturesource,youmustcalltheSelectSignalVIbeforeenablingthehigh-speedcapture.
High-speedcapturefunctionalityisperformedbytheencoderresourcesthemselves.WhenthisVIissenttoanaxis,itisactuallybeingsenttothemappedencoderresource.
Thehigh-speedinputshaveprogrammablepolarityandedgebehavior.YoucansetthepolarityoftheinputwiththeConfigureHigh-SpeedCaptureVI.Youcandeterminetheresultsofthehigh-speedcapturefromtheReadHigh-SpeedCaptureStatusandReadCapturedPositionVIs.
Forsinglehigh-speedcapture,youcanenableonlyonehigh-speedcaptureperaxisorencoderatatime.Whenanenabledeventiscaptured,thehigh-speedcaptureisautomaticallydisabled.Youmustexplicitlyre-enablehigh-speedcapturetouseitagain.Todisableapreviouslyenabledoperation,runthisVIagainwithHigh-SpeedCapturesettoFalse.
Forbufferedhigh-speedcapture,youneedtoenabletheinputtriggeronlyonce.Subsequenthigh-speedcapturesareautomaticallyre-enabledbythecontroller.ThisVIhasnoeffectwhentheinputtriggerisconfiguredasadigitalinput.
Ifyouareusingbufferedhigh-speedcapture,ensurethatthebufferisconfiguredbeforeyouexecutethisVI.RefertoConfigureBufferformoreinformation.
High-speedcaptureisusefulinregistrationandsynchronizationapplications.Youcancalculatesubsequentmovesrelativetothecapturedposition.Referto
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NI73xxControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwitha73xxmotioncontroller:
Ifyourapplicationincludesahigh-speedcapturethattakesplaceafteraFindReferencemovethatfindsanindex,youmustenablethehigh-speedcaptureafterthefindreferencemove.Ifyourapplicationincludesabufferedhigh-speedcapture,youmustalsoconfigurethebufferafterthefindreferencemove.NI73xxcontrollersdonotsupportmultiplesimultaneoushigh-speedcapturesperaxis.
NISoftMotionControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwiththeNISoftMotionController:
TheNISoftMotionControllersupportsmultiplesimultaneoushigh-speedcapturesperaxis.
TousethisVItoconfiguretheNISoftMotionControllertoenablemultiplehigh-speedcapturesonanaxis,settheupperfourbitsoftheresourceIDtothefollowing.
Type ValuePrimaryHSCapture 0X0SecondaryHSCapture 0XA0
Forexample,toenabletheprimaryhigh-speedcapturestatusonaxis1,set
ReadCapturedPositionReadsacapturedpositionvaluefromanaxisorencoder.
DetailsRemarks
DeviceCompatibility
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.AxisorEncoderistheaxisorencodertoread.RetVectindicatesthedestinationforthereturndatageneratedbythisVI.Availablereturnvectorsincludereturndatatothehost(0xFF),returndatatoavariable(0x01through0x78),returndatatoanindirectvariable(0x81through0xF8),anddonotreturndata(0).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,
UsingThisVI
TheReadCapturedPositionVIreturnsthevalueinthehigh-speedcaptureregisteroftheaxisorencoderselected.Thisvaluewascapturedwhenanenabledhigh-speedcaptureinputwentactive.
High-speedcapturefunctionalityisperformedbytheencoderresourcesthemselves.WhenthisVIissenttoanaxis,thevaluereturnedisactuallyfromthemappedencoderresource.
Forbufferedhigh-speedcapture,thecapturedpositionsarestoredinabuffer.UseReadBuffertoreadthecapturedpositions.
RefertotheEnableHigh-SpeedCaptureandReadHigh-SpeedCaptureStatusVIsformoreinformationaboutthehigh-speedcaptureinputsandtypicalapplications.
NoteForclosed-loopsteppersystemsinwhichtheencodercounts-per-revolutiondiffersfromthesteps-per-revolution,thecapturedpositionisinencodercounts.
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NI73xxControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwitha73xxmotioncontroller:
NI73xxcontrollersdonotsupportmultiplesimultaneoushigh-speedcapturesperaxis.
NISoftMotionControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwiththeNISoftMotionController:
TheNISoftMotionControllersupportsmultiplesimultaneoushigh-speedcapturesperaxis.
TousethisVItoreadmultiplehigh-speedcapturepositionsonanaxis,settheupperfourbitsoftheresourceIDtothefollowing.
Type ValuePrimaryHSCapture 0X0SecondaryHSCapture 0XA0
Forexample,toenabletheprimaryhigh-speedcapturestatusonaxis1,settheresourceIDto0X01.Toenablethesecondaryhigh-speedcapturestatusonaxis1,settheresourceIDto0XA1.
ReadHigh-SpeedCaptureStatusReadsthehigh-speedpositioncapturestatusforallaxesorencoders.
NoteYoucannotusethisVItoreadthestatusofbufferedhigh-speedcaptures.UseCheckBuffertogetthestatusofthebuffer.
DetailsRemarks
DeviceCompatibility
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.AxisorEncoderistheaxiscontrolorencodercontrolselector.Formulti-axisstatus,use0(zero).Formulti-encoderstatus,use0x20.RetVectindicatesthedestinationforthereturndatageneratedbythisVI.Availablereturnvectorsincludereturndatatothehost(0xFF),returndatatoavariable(0x01through0x78),returndatatoanindirectvariable(0x81through0xF8),anddonotreturndata(0).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassesthe
UsingThisVI
TheReadHigh-SpeedCaptureStatusVIallowsyoutoseeifapositioncapturehasoccurredorispending.Whenconfiguredasasinglehigh-speedcapture,thecorrespondingstatusbitissetwhenaninputtriggerbecomesactive,asconfiguredinConfigureHigh-SpeedCapture.Thestatusbit,alongwiththecapturedencoderposition,islatcheduntiltheinputtriggerisre-enabled.Whenthepositioncaptureoccurs,itsstatusbitissettoTrue(1).RefertotheReadCapturedPositionVIforinformationaboutretrievingthecapturedpositionvalue.
Example
ExecutingtheReadHigh-SpeedCaptureStatusVIwithAxisorEncoder=0returnsHighSpeedCaptureStatus,asshowninthefollowingtable.
Axis1 Axis2 Axis3 Axis4 Axis5 Axis6 Axis7 Axis8False True True False False False False False
Onencodersmappedtoaxes2and3,high-speedcaptureshaveoccurred,butallothercapturesarependingorwereneverenabled.
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NI73xxControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwitha73xxmotioncontroller:
Thehigh-speedcapturecircuitryisalsousedduringFindIndexexecution.Whenanindexisfoundsuccessfully,thecapturestatusforthecorrespondingencoderandaxisissettoTrueasasideeffect.ExecutingtheFindReferenceIndexVIautomaticallyleavesthecorrespondinghigh-speedcaptureinputdisabledaftertheindexisfound.
FindReferenceVIsYoucanusetheseVIstoinitializethemotionsystemandestablisharepeatablereferenceposition.
Typicalclosed-loopmotionsystemsuseincrementalfeedbacktokeeptrackofposition.Atpower-up,thispositionismeaninglessuntilazeroreferencepositionisestablished.Open-loopsteppersystemsmustalsobeinitializedatpower-up.
NI-Motionprovidestwobuilt-inVIs,FindReferenceandWaitReference,toaccomplishthesetasks.FindReferenceperformssearchsequencestofindandstoponaspecificedgeofthehomeinput,findthenextinstanceoftheencoderindex,findthecenteroftravelbetweenforwardandreverselimits,orfindtheforward/reverselimit.WaitReferencereturnswhenaninitiatedfindhascompleted.Inthiswayarepeatablereferencepositionthatisaccuratetooneencodercountisestablished.
ClicktheiconsforVIdescriptions.
FindReference
CheckReference
WaitReference
ReadReferenceStatus
LoadReferenceParameter
GetReferenceParameter
CheckReferenceChecksthestatusofasearchsequenceinitiatedbyFindReference.
Details
DeviceCompatibility
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.Axis/VSMap(Disabled)isthebitmapofaxesorvectorspaces(coordinatespaces)tousewiththisVI.ItisonlyrequiredwhenmultipleaxesorvectorspacesareselectedwiththeAxisorVectorSpaceparameter.Otherwise,thisparameterisignored.
Whensearchingonmultipleaxes(AxisorVectorSpace=AxisControl):
Axis1—IfTRUE,checkreferenceonthespecifiedaxis.IfFALSE,donotcheckreferenceonthespecifiedaxis.Axis2—IfTRUE,checkreferenceonthespecifiedaxis.IfFALSE,donotcheckreferenceonthespecifiedaxis.Axis3—IfTRUE,checkreferenceonthespecifiedaxis.IfFALSE,donotcheckreferenceonthespecifiedaxis.Axis4—IfTRUE,checkreferenceonthespecifiedaxis.IfFALSE,donotcheckreferenceonthespecifiedaxis.Axis5—IfTRUE,checkreferenceonthespecifiedaxis.IfFALSE,donotcheckreferenceonthespecifiedaxis.Axis6—IfTRUE,checkreferenceonthespecifiedaxis.IfFALSE,
UsingThisVI
ThisVIreturnswhetherthereferenceontheindicatedaxesisfound.Thereisnoneedtospecifywhattypeoffindtowaitforbecausethecontrollerknowswhatsearchesarebeingdoneonwhataxes.ThisVIwaitsforandreportsonthesuccessofthecurrentorlastexecutedfindonanaxis,vectorspace,oragivensetofaxesorvectorspacesasawhole.
IfaFindReferenceisexecutedwiththeRunSequenceoptiontheCheckReferenceVIdoesnotrequireanAxisorVectorSpaceorAxis/VSMap.WhenwaitingonaRunSequence,theCheckReferenceVIreturnsthestatusoftheentiresequence.TheFoundReferenceBooleanreturnsTrueonlyifandwhenalloftheoperationsinthesequencearesuccessful.
WaituntiltheFindingReferenceparameterisfalsebeforecheckingthestatusoftheFoundReferenceparameter.ThestatusoftheFoundReferenceparameterisundefinedwhenFindingReferenceistrue.TheWaitReferenceVIdoesthisforyou,butyoucannotexecuteanyotherVIswhileWaitReferenceisrunning.
Example
YouinitiatedaFindHomeonAxis1,andFindCenteronAxis2andAxis3,andyouwanttocheckifallaxeshavefoundtheirreference.CallCheckReferencewiththefollowingparameters:
AxisorVectorSpace=AxisControl(0)Axis/VSMap=00001110(axis1,2,&3enabled)
FindReferenceExecutesasearchoperationtofindareferenceposition:
homeindex
forwardlimitreverselimit
centerrunsequence
DetailsRemarks
DeviceCompatibility
SearchTypeisthetypeofsearchexecutedbytheFindReferenceVI.
Value Definition Description
0 FindHome ExecutesaFindHomeonthegivensetofaxes.
1 FindIndex ExecutesaFindIndexonthegivensetofaxes.
2 FindCenter Findsthecenteroftravelonagivensetofaxes.
3 FindForwardLimit Findstheforwardlimitonagivensetofaxes.
4 FindReverseLimit Findsthereverselimitonagivensetofaxes.
5 RunSequence RunstheloadedFindSequence.BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfrom
UsingThisVI
ThisVIreturnsimmediatelyafterstartingthegivenfindoperation.UsethisVIinconjunctionwithWaitReferencetodeterminewhenthefindoperationcompletesandifthefindwassuccessful.
YoucanmanuallystopasearchoperationusingMAXorbycallingtheStopMotionVI.Whenencounteringalimitorhomeinput,asearchoperationperformsahaltstopandthencontinuesbasedontheSearchType.Anunexpectedlimitconditionduringafindstopsthesequenceandgeneratesamodalerror.RefertoErrorsandErrorHandlingforinformationabouterrors.
NoteYoumustsetunusedlimitandhomeinputstotheirinactivestateusingMAXorwiththeEnableLimitsandEnableHomeInputsVIs.NoteForwardisdefinedasthedirectionofincreasingposition.TheForwardandReverseLimitsmustbelocatedattheproperendsoftravelforFindReferencetofunctionproperly.
YoucanaccesssettingsforFindReferencethroughMAX,LoadReferenceParameterandGetReferenceParameter.ForadetaileddescriptiononhowthesesettingsaffectagivenSearchType,refertothesectiononeachtype.Mostofthesesettingsareonaper-SearchTypebasis.
NoteIfyoustartacoordinate(vector)space,FindReferenceactuallystartstheaxesindividually,soitisnotacoordinatedvectormove.
SearchTypes
FindHome
FindIndex
FindCenter
FindForwardandReverseLimits
RunSequence
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NI73xxControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwitha73xxmotioncontroller:
Ifyourapplicationincludesahigh-speedcapturethattakesplaceafteraFindReferencemovethatfindsanindex,youmustenablethehigh-speedcaptureafterthefindreferencemove.Ifyourapplicationincludesabufferedhigh-speedcapture,youmustalsoconfigurethebufferafterthefindreferencemove.WhenperformingaresetpositionaspartofaFindReferenceoperation,addatleastoneofthefollowingtothemovecompletecriteriatoensurethatthemotorisnotmovingwhentheresetpositionexecutes:
Addadelayaftertheprofilecompletestatusistruetoallowsufficienttimebetweentheoutputandresetpositionforthemotortostop.UseConfigureMoveCompleteCriteriatoconfigureadelay.Usethein-positionsignalasacriteriaformovecomplete.TheNIPCI-7390controllerusesthissignalbydefault.ToaddthissignaltothemovecompletecriteriaforcontrollersotherthantheNIPCI-7390,useConfigureMotionI/OMaptomapthesignaltoapinandthenuseWriteTrajectoryDatatoaddin-positiontothemovecompletecriteria.Inaddition,configurethein-positionrangeonthedrivetoasmallenoughnumbertoensurethatthetargetpositionisreached.Refertoyourdrivedocumentationforinformationaboutconfiguringthein-positionrangeonthedrive.
GetReferenceParameterGetsthevalueforthespecifiedfindreferenceparameter.
DetailsRemarks
DeviceCompatibility
ParameterTypeisthetypeofparametertoget.Validvaluesare:InitialSearchDirectionFinalApproachDirectionEdgeToStopOnSmartEnableEnableResetPositionOffsetPositionPrimaryResetPositionSecondaryResetPositionApproachVelocityPercentSequenceSearchOrderEnableSearchDistanceSearchDistancePhaseAReferenceStatePhaseBReferenceStateSearchTypeisthetypeofreferencetoget.PossibleSearchTypevaluesareFindHome,FindIndex,FindCenter,andFindForward&Reverse
UsingThisVI
UsethisVItogettheparametersforFindReference.
InitialSearchDirection—If1,searchreverse.If0(default),searchforward.FinalApproachDirection—1istrueand0isfalse(default).ThefollowingtableliststhebehavioroftheFinalApproachDirectionparameterforeachtypeoffind:
FindType FinalApproachDirectionisTrue(1)
FinalApproachDirectionisFalse(0)
FindHome reverseapproach forwardapproachFindCenterFindForwardLimitFindReverseLimit
oppositetodirectionoftravelintolimit
sameasthedirectionoftravelintolimit
FindIndex N/A N/A
NoteForFindCenter,thisvaluereferstohowthecontrollerbehaveswhenapproachingandmarkingthepositionofthelimitstofindtheircenter.
EdgetoStopOn—AppliesonlytoFindHome.If1,reverseedge.If0(default),forwardedge.ApproachVelocityPercent—Thepercentoftheloadedvelocitythatagivenaxisusestoperformfinaladjustments.RefertotheRemarkssectionforvalidvalues.
FindIndexusesthispercentvelocitythroughouttheentiresearchroutine.SmartEnable—If1,appropriatelyenablesordisablesthelimitsandhomeinputbeforeexecutingafind.Thelimitsandhomeinputarereturnedtotheiroriginalstateafterthefindoperationiscomplete.TodeterminewhatstateSmartEnablesetsthelimitsorhomeinputto,refertotheappropriateSearchTypedescription.If0,youmustmanually
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NI73xxControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwitha73xxmotioncontroller:
TheresolutionofApproachVelocityPercentisapproximately0.4%FortheNI73xxcontrollers,ApproachVelocityPercentisasingle-precisionfloating-pointvaluefrom0.4%to150%.Thisvaluedirectlyscalestheprogrammedvelocity.Thedefaultvalueis20%.
NISoftMotionControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwiththeNISoftMotionController:
SecondaryResetPositionisnotsupportedbytheNISoftMotionController.PhaseAReferenceStateandPhaseBReferenceStatearenotsupportedonCANopendevices.PrimaryResetPositionmustbesetto0whenyouareusingtheNISoftMotionControllerfortheCopleyControlsCANopendrives,AccelnetandXenus.TheNISoftMotionControllersupportsthefull64-bitfloatingpointrangefortheApproachVelocityPercentparameter.TheNISoftMotionControllerrequiresSearchDistance,andthus,EnableSearchDistanceisalways1(true).
LoadReferenceParameterLoadsthevalueforthespecifiedfindreferenceparameter.
DetailsRemarks
DeviceCompatibility
ParameterTypeisthetypeofparametertoload.Validvaluesare:
InitialSearchDirectionFinalApproachDirectionEdgeToStopOnSmartEnableEnableResetPositionOffsetPositionPrimaryResetPositionSecondaryResetPositionApproachVelocityPercentSequenceSearchOrderEnableSearchDistanceSearchDistancePhaseAReferenceStatePhaseBReferenceState
SearchTypeisthetypeofreferencetoload.PossibleSearchTypevaluesareFindHome,FindIndex,FindCenter,andFindForward&ReverseLimits.
UsingThisVI
UsethisVItoloadtheparametersforFindReference.ThefollowingarevalidvaluesforeachParameterType:
InitialSearchDirection—Enter1tosearchinthereversedirection.Enter0(default)tosearchintheforwarddirection.FinalApproachDirection—Enter1fortrueand0forfalse(default).ThefollowingtableliststhebehavioroftheFinalApproachDirectionparameterforeachtypeoffind:
FindType FinalApproachDirectionisTrue(1)
FinalApproachDirectionisFalse(0)
FindHome reverseapproach forwardapproachFindCenterFindForwardLimitFindReverseLimit
oppositetodirectionoftravelintolimit
sameasthedirectionoftravelintolimit
FindIndex N/A N/A
NoteForFindCenter,thisvaluereferstohowthecontrollerbehaveswhenapproachingandmarkingthepositionofthelimitstofindtheircenter.
EdgetoStopOn—AppliesonlytoFindHome.Enter1tostoponthereverseedge.Enter0(default)tostopontheforwardedge.ApproachVelocityPercent—Thepercentoftheloadedvelocitythatagivenaxisusestoperformfinaladjustments.RefertotheRemarkssectionforvalidvalues.
FindIndexusesthispercentvelocitythroughouttheentiresearchroutine.SmartEnable—Avalueof1(true)appropriatelyenablesordisablesthelimitsandhomeinputbeforeexecutingafind.Thelimitsandhomeinputarereturnedtotheiroriginalstateafterthefindoperationiscomplete.TodeterminewhatstateSmartEnablesetsthelimitsorhomeinputto,refer
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NI73xxControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwitha73xxmotioncontroller:
TheresolutionofApproachVelocityPercentisapproximately0.4%FortheNI73xxcontrollers,ApproachVelocityPercentisasingle-precisionfloating-pointvaluefrom0.4%to150%.Thisvaluedirectlyscalestheprogrammedvelocity.Thedefaultvalueis20%.
NISoftMotionControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwiththeNISoftMotionController:
SecondaryResetPositionisnotsupportedbytheNISoftMotionController.PhaseAReferenceStateandPhaseBReferenceStatearenotsupportedonCANopendevices.PrimaryResetPositionmustbesetto0whenyouareusingtheNISoftMotionControllerfortheCopleyControlsCANopendrives,AccelnetandXenus.TheNISoftMotionControllersupportsthefull64-bitfloatingpointrangefortheApproachVelocityPercentparameter.TheNISoftMotionControllerrequiresSearchDistance,andthus,EnableSearchDistanceisalways1(true).
ReadReferenceStatusReadsthecurrentlyselectedreferencestatusforthegivensetofaxesorcoordinate(vector)space.
Details
DeviceCompatibility
StatusTypeistheselectorforthetypeofreferencestatustoread.
Youcanchoosefromthefollowingstatustypes:
StatusType Description
HomeFound returnsTrueifthelastFindHomeexecutedsuccessfully
IndexFound returnsTrueifthelastFindIndexexecutedsuccessfully
CenterFound returnsTrueifthelastFindCenterexecutedsuccessfully
ForwardLimitFound
returnsTrueifthelastFindForwardLimitexecutedsuccessfully
ReverseLimitFound returnsTrueifthelastFindReverseLimitexecutedsuccessfully
ReferenceFound returnsTrueifthelastFindReferenceexecutedsuccessfully
UsingThisVI
ThisVIreadsthecurrentlyselectedreferencestatusforthegivensetofaxesorcoordinate(vector)space.
Ifmultipleaxesinacoordinatespaceareselectedusingtheaxisbitmap,allaxesmusthavesuccessfullyfoundtheirlastreferenceforHomeFound,IndexFound,CenterFound,ForwardLimitFound,ReverseLimitFound,andReferenceFoundtobetrue.
IfanyoftheselectedaxesarecurrentlyexecutingaFindReference,FindingReferenceistrue.WaituntilFindingReferenceisfalsebeforecheckingthestatusofanyotherattribute.ThestatusoftheHomeFound,IndexFound,CenterFound,ForwardLimitFound,ReverseLimitFound,andReferenceFoundstatustypesareundefinedwhenFindingReferenceistrue.TheWaitReferenceVIdoesthisforyou,butyoucannotexecuteanyotherVIswhileWaitReferenceisrunning.
WaitReferenceWaitsforasearchsequenceinitiatedbyFindReferencetocompleteandreturnsthestatus.WaitReferencealsocanbeusedtoquerythestatusofasearch.
Details
DeviceCompatibility
Timeout(ms)specifieshowlong,inmilliseconds,theWaitReferencecallwaitsbeforereturning.IfthetimeoutisreachedbeforethesearchcompletestheWaitReferenceReturns.Inthismanner,WaitReferencecanbeusedtocheckthestatusofasearchbypassingatimeoutof0.Bydefault,thetimeoutis4294967295or0xFFFFFFFF.Thisvalueishandleddifferently,signifyinganinfinitewaittime.Axis/VSMap(Disabled)isthebitmapofaxesorvectorspaces(coordinatespaces)tousewiththisVI.ItisonlyrequiredwhenmultipleaxesorvectorspacesareselectedwiththeAxisorVectorSpaceparameter.Otherwise,thisparameterisignored.
Whensearchingonmultipleaxes(AxisorVectorSpace=AxisControl):
Axis1—IfTRUE,waitonthespecifiedaxis.IfFALSE,donotwaitonthespecifiedaxis.Axis2—IfTRUE,waitonthespecifiedaxis.IfFALSE,donotwaitonthespecifiedaxis.Axis3—IfTRUE,waitonthespecifiedaxis.IfFALSE,donotwaitonthespecifiedaxis.
UsingThisVI
ThisVIreturnswhenthefindontheindicatedaxesfinishesorthetimeoutisreached,whicheveroccursfirst.Thereisnoneedtospecifywhattypeoffindtowaitforbecausethecontrollerknowswhatsearchesarebeingdoneonwhataxes.ThisVIwaitsforandreportsonthesuccessofthecurrentorlastexecutedfindonanaxis,vectorspace,oragivensetofaxesorvectorspacesasawhole.
IfaFindReferenceisbeingexecutedwiththeRunSequenceoptiontheWaitReferenceVIdoesnotrequireanAxisorVectorSpaceorAxis/VSMap.WhenwaitingonaRunSequence,theWaitReferenceVIreturnswhentheentiresequencehasfinished.TheFoundReferenceBooleanreturnsTrueonlyifalloftheoperationsinthesequenceweresuccessful.
NoteYoucannotexecuteanyotherprocesseswhiletheWaitReferenceVIisrunning.UseCheckReferenceorReadReferenceStatusifyouwanttorunotherprocessessimultaneously.
Example
YouinitiatedaFindHomeonAxis1,andFindCenteronAxis2andAxis3,andyouwanttowaitforallfindsequencestofinishbeforeproceedingwiththerestoftheprogram.SimplycallWaitReferencewiththefollowingparameters:
AxisorVectorSpacesettoAxisControl(0)AxisMapsetto00001110(axis1,2,&3enabled)TimeoutisUnwired
Analog&DigitalI/OVIsYoucanusetheanaloganddigitalI/OVIstocontrolthegeneral-purposeanaloganddigitalI/OresourcesontheNImotioncontroller.Theseresourcesincludeupto32bitsofgeneral-purposedigitalI/O,PWMoutputs,RTSIlines,andanyextraencoders,ADCchannels,andDACoutputsthatarenotmappedtoanaxis.
The32bitsofdigitalI/OareavailableontheDigitalI/OConnector.Thesebitsareorganizedinto8-bitportsthatyoucanconfigureasinputsoroutputsonaport-wisebasis,oronabitwisebasis.Eachbithasindividuallyprogrammablepolaritythatyoucanconfigureasactiveloworactivehigh.Youcanusethegeneral-purposedigitalI/Oforsystemintegrationapplicationsincludingoperatorpanelswitchinputsandoutputs,relayandsolenoidactivation,triggerI/Obetweenothercontrollersand/orinstrumentsinthesystem,andsoon.
Youcanuseencoders,ADCchannels,andDACoutputsthatarenotmappedtoanaxisforgeneral-purposeI/O.Typicalusesforencoderinputsincludevelocitymonitoring,mastersformaster-slavegearing,anddigitalpotentiometerapplications.
YoucanuseunusedADCinputsandDACoutputsforanyanalogI/Othatiswithintheirspecifications.Typicalanaloginputapplicationsincludeanalogjoysticks,potentiometers,force,pressure,levelandstrainsensors,andsoon.Analogoutputapplicationsvaryfromheaterelementcontroltolaserintensitymodulation.
ClicktheiconsforVIdescriptions.
SetI/OPortDirection EnableEncodersSetI/OPortPolarity ReadEncoderPositionSetI/OPortMOMO ResetEncoderPositionReadI/OPort ConfigureEncoderFilterEnableADCs ConfigureEncoderPolarityReadADC ConfigurePWMOutputSetADCRange LoadPWMDutyCycleLoadDAC SelectSignal
ConfigureEncoderFilterSelectsthemaximumcountfrequencyforanencoderchannelbyconfiguringitsdigitalfilter.
Details
DeviceCompatibility
Frequency(1.6MHz)selectsthemaximumcountfrequencyforthespecifiedencoder.
FrequencyValue MaximumCountFrequency0 25.6MHz1 12.8MHz2 6.4MHz3 3.2MHz4 1.6MHz(default)5 800kHz6 400kHz7 200kHz8 100kHz9 50kHz10 25kHz11 DisabledBoardIDisauniquenumberassignedbyMeasurement&Automation
UsingThisVI
Settingthemaximumallowablecountfrequencyforanencoderisusefulforreducingtheeffectofnoiseontheencoderlines.Noiseontheencoderlinescanbeinterpretedasextraencodercounts.Bysettingthefrequencytothelowestpossiblesettingrequiredforthemotionapplication,youcanensurethehighestdegreeofaccuracyinpositioning.Inchoosingtheappropriatevalue,youmusttakeintoaccountthecountsperrevolutionoftheencoderandthemaximumvelocityfortheaxisinquestion.
Forexample,witha20,000countsperrevolutionencoderandamaximumvelocityof3,000RPM(50revolutionspersecond),theencodersignalcouldbeashighas1,000,000countspersecond.Afrequencyvalueof4,whichwouldcorrespondtoamaximumcountfrequencyof1.6MHzwouldbeappropriateinthiscase.
IfyounevercallthisVI,adefaultvalueof4(1.6MHz)isused.
TipWhentheencoderfilterischanged,resetthepositiontopreventanerroneouscount.
ConfigureEncoderPolarityConfigurestheencoderPhaseA,PhaseB,andIndexlinepolarities.
Details
DeviceCompatibility
PhaseAsetsthepolarityforencoderPhaseAtoactiveloworactivehigh.
Encoder1—Iftrue,activehigh(default).Iffalse,activelow.Encoder2—Iftrue,activehigh(default).Iffalse,activelow.Encoder3—Iftrue,activehigh(default).Iffalse,activelow.Encoder4—Iftrue,activehigh(default).Iffalse,activelow.Encoder5—Iftrue,activehigh(default).Iffalse,activelow.Encoder6—Iftrue,activehigh(default).Iffalse,activelow.Encoder7—Iftrue,activehigh(default).Iffalse,activelow.Encoder8—Iftrue,activehigh(default).Iffalse,activelow.
IndexsetsthepolarityfortheencoderIndextoactiveloworactivehigh.Encoder1—Iftrue,activehigh(default).Iffalse,activelow.Encoder2—Iftrue,activehigh(default).Iffalse,activelow.Encoder3—Iftrue,activehigh(default).Iffalse,activelow.Encoder4—Iftrue,activehigh(default).Iffalse,activelow.Encoder5—Iftrue,activehigh(default).Iffalse,activelow.Encoder6—Iftrue,activehigh(default).Iffalse,activelow.Encoder7—Iftrue,activehigh(default).Iffalse,activelow.Encoder8—Iftrue,activehigh(default).Iffalse,activelow.
BoardIDisauniquenumberassignedbyMeasurement&Automation
UsingThisVI
TheConfigureEncoderPolarityVIconfiguresthepolaritiesfortheencoderPhaseA,PhaseB,andIndexlines.ConfigureencoderpolaritiesbeforecallingtheEnableEncodersVI.
Youcanconfiguretheencoderpolarityasactiveloworactivehigh.Whenconfiguredasactivelow,theinputisactivewhenthereisalowsignalontheinputpin.Conversely,activehighmeansthattheinputisactivewhenthereisahighsignalontheinputpin.
NoteSettingPhaseAandPhaseBincorrectlycausesthefeedbacktoappeartomoveintheoppositedirection.Forexample,ifPhaseAorPhaseBisthewrongpolaritywhenmovingintheforwarddirection,thepositionappearstomoveinthereversedirection.Theoppositeoccurswhenmovinginthereversedirection.Ifbotharesetincorrectly,motionoccursinthecorrectdirectionbuttheindexmightnotworkcorrectly.
ConfigurePWMOutputEnablesanddisablesPWMoutputs,andsetsthePWMclockfrequency.
Details
DeviceCompatibility
ClockFrequencyspecifiestheclockfrequencyforthePWMoutput.
ThebaseclockfrequencyforthePWMoutputsis24.81MHzonthe7340and7330controllers,24.58MHzonthe7350controller,and20.48on7334/42/44controllers.Thisbaseclockfrequencyisdivideddowndependingontheclockvalueselected.
ThefollowingtabledescribesthePWMclockfrequencysettings:
ClockDividerValue
ClockValue*
7334/42/44ClockFrequency
7330/40ClockFrequency
7350ClockFrequency
512 0 40.00kHz 48.46kHz 48.01kHz1K 1 20.00kHz 24.23kHz 24.00kHz2K 2 10.00kHz 12.11kHz 12.00kHz4K 3 5.00kHz 6.06kHz 6.00kHz8K 4 2.50kHz 3.03kHz 3.00kHz16K 5 1.25kHz 1.51kHz 1.50kHz33K 6 625.00Hz 757.14Hz 750.09Hz
ConfigurePWMOutputEnablesanddisablesPWMoutputs,andsetsthePWMclockfrequency.
Details
DeviceCompatibility
ClockFrequencyspecifiestheclockfrequencyforthePWMoutput.
ThebaseclockfrequencyforthePWMoutputsis24.81MHzonthe7340and7330controllers,24.58MHzonthe7350controller,and20.48on7334/42/44controllers.Thisbaseclockfrequencyisdivideddowndependingontheclockvalueselected.
ThefollowingtabledescribesthePWMclockfrequencysettings:
ClockDividerValue
ClockValue*
7334/42/44ClockFrequency
7330/40ClockFrequency
7350ClockFrequency
512 0 40.00kHz 48.46kHz 48.01kHz1K 1 20.00kHz 24.23kHz 24.00kHz2K 2 10.00kHz 12.11kHz 12.00kHz4K 3 5.00kHz 6.06kHz 6.00kHz8K 4 2.50kHz 3.03kHz 3.00kHz16K 5 1.25kHz 1.51kHz 1.50kHz33K 6 625.00Hz 757.14Hz 750.09Hz
UsingThisVI
ThePWMoutputsontheNImotioncontrolleraredigitalpulse-trainoutputsthathaveafrequencyspecifiedbytheclockparameterofthisVIandadutycyclespecifiedbytheLoadPWMDutyCycleVI.TheseoutputscanbeusedtocontroldevicesthatrequireaPWMinput,suchasalaserwhoseintensityiscontrolledbyaPWMsignal,orcanbeusedtogenerateisolatedanalogoutputsbypassingthePWMoutputthroughanoptocoupler,andthenfilteringthedigitalpulsetraintoproduceananalogoutputvoltage.
WhenyouconfigureaPWMoutput,theclockfrequencyappliestobothPWMoutputs.IfyouconfigureonePWMoutputforaclockvalueof3,andthenthesecondPWMoutputforaclockvalueof4,thevalueof4appliestobothPWMoutputs.
TheonlyexceptioniswhentheclocksettingsforthetwoPWMoutputsare0and8,1and9,2and10,andsoon,inwhichcaseeachoutputhasadifferentfrequency.Thisisbecauseclockvalues0–7and8–15arepaired.Clockvalues0and8usethecommontimebaseof10.24MHz(12.8MHzonthe7350).Thefrequencyofclockvalue0isfoundbydividingthetimebaseby256,whileclockvalue8isfoundbydividingthetimebaseby32768.IfyouhaveanNI7344controllerandyouswitchchannelBtoclockvalue10,thetimebasechangesto2.56MHz.ThischangealsoswitcheschannelAto2.56/256=10kHz.Therefore,ifthevalueinonesetchanges,itswitchestheotherchanneltothepairingclockvalue.Ifthetwovaluesareinthesamegroup,thetwochannelshavethesamefrequency.
Touseanexternalclock(clockvaluesof7or15),connecttheexternalclocksignaltothePCLKinputontheDigitalI/Oconnector.
EnableADCsEnablesoneormoreoftheunmappedADCchannels.
Details
DeviceCompatibility
ADCMap(Enabled)isthebitmapofADCchannelstoenable:IfADCMap0isTRUE(default)theADCchannelisenabled.IfitisFALSEtheADCchannelisdisabled.IfADCMap1isTRUE(default)theADCchannelisenabled.IfitisFALSEtheADCchannelisdisabled.IfADCMap2isTRUE(default)theADCchannelisenabled.IfitisFALSEtheADCchannelisdisabled.IfADCMap3isTRUE(default)theADCchannelisenabled.IfitisFALSEtheADCchannelisdisabled.IfADCMap4isTRUE(default)theADCchannelisenabled.IfitisFALSEtheADCchannelisdisabled.IfADCMap5isTRUE(default)theADCchannelisenabled.IfitisFALSEtheADCchannelisdisabled.IfADCMap6isTRUE(default)theADCchannelisenabled.IfitisFALSEtheADCchannelisdisabled.IfADCMap7isTRUE(default)theADCchannelisenabled.IfitisFALSEtheADCchannelisdisabled.
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.errorin(noerror)describeserrorconditionsthatoccurbeforethisVI
UsingThisVI
TheEnableADCsVIenablesoneormoreindependentADCchannelsforuseasgeneral-purposeanaloginputs.ThecontrollerreturnsanerrorifyouattempttoenableordisableanADCbeingusedasanaxisfeedbackwhentheaxisisenabled.Thesefeedbackchannelsareautomaticallyenabled/disabledwhenyouenableordisabletheircorrespondingaxiswiththeEnableAxesVI.Youmustfirstdisabletheaxisusinganalogfeedback,thenenableordisableADCs.
TheNI-MotionAnalog-to-DigitalConverter(ADC)multiplexesbetweenchannelswithascanrateofapproximately40µsperchannelforthe7340motioncontroller,and25µsperchannelforthe7350motioncontroller.Therefore,thetimebetweensamplesforaspecificADCchannelisasfollows:
7330/40:ADCsampletime=40µs/channel×(numberofenabledchannels)
7350:ADCsampletime=25µs/channel×(numberofenabledchannels)
Bydefault,allchannelsareenabledatpower-up.Youmustdisableunusedchannelstoincreasethescanrateanddecreasethesampletime.
The40µs/channelscanrateisfastenoughtosupportanalogfeedbackatthefastestPIDupdateratesaslongasnoadditionalADCchannelsareenabled.
Example
ToenableADCchannels1,3,5,and7onthe7350motioncontroller,calltheEnableADCsVIwithAxisMap,asfollows.
0(ADC1)
1(ADC2)
2(ADC3)
3(ADC4)
4(ADC5)
5(ADC6)
6(ADC7)
7(ADC8)
True False True False True False True False
Undernormalconditions,becauseADCchannels2,4,6,and8aresettoFalse,theyaredisabledwhenyouexecutethisVI.However,ifADCchannel2is
EnableEncodersEnablesoneormoreoftheunmappedencoderresources.
Details
DeviceCompatibility
EncoderMap(Disabled)isthebitmapofencoderresourcestoenable.Encoder1—Iftrue,theencoderisenabled.Iffalse,theencoderisdisabled(default).Encoder2—Iftrue,theencoderisenabled.Iffalse,theencoderisdisabled(default).Encoder3—Iftrue,theencoderisenabled.Iffalse,theencoderisdisabled(default).Encoder4—Iftrue,theencoderisenabled.Iffalse,theencoderisdisabled(default).Encoder5—Iftrue,theencoderisenabled.Iffalse,theencoderisdisabled(default).Encoder6—Iftrue,theencoderisenabled.Iffalse,theencoderisdisabled(default).Encoder7—Iftrue,theencoderisenabled.Iffalse,theencoderisdisabled(default).Encoder8—Iftrue,theencoderisenabled.Iffalse,theencoderisdisabled(default).
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.errorin(noerror)describeserrorconditionsthatoccurbeforethisVI
UsingThisVI
TheEnableEncodersVIenablesoneormoreindependentencoderchannelsforuseasgeneral-purposeencoderinputs.Ithasnoeffectonencodersthataremappedtoaxesandbeingusedforaxisfeedback.Thesefeedbackencodersareautomaticallyenabled/disabledwhentheircorrespondingaxisisenabledordisabledwiththeEnableAxesVI.Bitlocationscorrespondingtomappedencodersareignored,asareencoderresourcesthatdonotexist.Forexample,encoderresources5through8areignoredforcontrollersthatsupportamaximumoffouraxes.
Typicalusesforindependentencoderinputsincludevelocitymonitoring,mastersformaster-slavegearing,anddigitalpotentiometerapplications.
Example
Toenableencoders3and4onthemotioncontroller,calltheEnableEncodersVIwiththefollowingEncoderMap.
Encoder1 Encoder2 Encoder3 Encoder4 Encoder5 Encoder6 Encoder7 Encoder8False False True True False False False False
Normally,becauseencoders1,2,5,and6aresettoFalse,theyisdisabledwhenyouexecutethisVI.However,ifencoder2isalreadybeingusedasfeedbackforaxis2andaxis1isnotbeingused,thedisableFalseforEncoder2isignoredresultinginthefollowingenabledencoders.
Encoder1 Encoder2 Encoder3 Encoder4 Encoder5 Encoder6 Encoder7 Encoder8False True True True False False False False
Thereisalimitonthenumberofenabledencoderssupportableatthefasterupdaterates.Attemptingtoenabletoomanyencodersgeneratesanerror.RefertotheEnableAxesformoreinformationaboutupdateratelimitations.
UsingThisVI
TheEnableEncodersVIenablesoneormoreindependentencoderchannelsforuseasgeneral-purposeencoderinputs.Ithasnoeffectonencodersthataremappedtoaxesandbeingusedforaxisfeedback.Thesefeedbackencodersareautomaticallyenabled/disabledwhentheircorrespondingaxisisenabledordisabledwiththeEnableAxesVI.Bitlocationscorrespondingtomappedencodersareignored,asareencoderresourcesthatdonotexist.Forexample,encoderresources5through8areignoredforcontrollersthatsupportamaximumoffouraxes.
Typicalusesforindependentencoderinputsincludevelocitymonitoring,mastersformaster-slavegearing,anddigitalpotentiometerapplications.
Toenableencoders3and4onthemotioncontroller,calltheEnableEncodersVIwiththefollowingEncoderMap.
Encoder1 Encoder2 Encoder3 Encoder4 Encoder5 Encoder6 Encoder7 Encoder8False True True False False False False
Normally,becauseencoders1,2,5,and6aresettoFalse,theyisdisabledwhenyouexecutethisVI.However,ifencoder2isalreadybeingusedasfeedbackforaxis2andaxis1isnotbeingused,thedisableFalseforEncoder2isignoredresultinginthefollowingenabledencoders.
Encoder1 Encoder2 Encoder3 Encoder4 Encoder5 Encoder6 Encoder7 Encoder8True True True False False False False
Thereisalimitonthenumberofenabledencoderssupportableatthefasterupdaterates.Attemptingtoenabletoomanyencodersgeneratesanerror.RefertotheEnableAxesVIformoreinformationaboutupdateratelimitations.
LoadDACLoadsanoutputvaluetoanunmappedDACresource.
DetailsRemarks
DeviceCompatibility
DACValue(0)isthevaluesenttotheDAC.Theparameterrangeis-32,768to+32,767,correspondingtothefull±10Voutputrange.
NoteDACtorquelimitsandoffsetsdonotapplywhendirectlyloadingaDAC.
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.DACistheDACtocontrol.InpVectindicatesthesourceofthedataforthisVI.Availableinputvectorsincludeimmediate(0xFF),variable(0x01through0x78),orindirectvariable(0x81through0xF8).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.
UsingThisVI
TheLoadDACVIisusedtosendavaluedirectlytoanunmappedDACresource.DACsnotmappedasservoaxisoutputsareavailableforgeneral-purposeanalogoutputapplications.
CautionYoumustnotexecutethisVIonaDACmappedtoanaxis.DoingsocausestheDACoutputtoglitchmomentarilybeforereturningtoaxiscontrol.
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NISoftMotionControllerConsiderations
ThefollowingincludesconsiderationsyoumustmakewhenyouareusingthisVIwiththeNISoftMotionController:
Iftheaxisisenabled,thecontrolloophasownershipofthedrivecommandoutput,andthevaluethatthisVIsendsisignored.
LoadPWMDutyCycleSetsthedutycycleforaPWMoutput.
Details
DeviceCompatibility
DutyCycle(0)isavaluebetween0and255thatspecifiestheamountoftimethePWMoutputishigh.BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.PWMOutputselectsthePWMOutputtoconfigure(1or2).InpVectindicatesthesourceofthedataforthisVI.Availableinputvectorsincludeimmediate(0xFF),variable(0x01through0x78),orindirectvariable(0x81through0xF8).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.
UsingThisVI
TheDutyCycledeterminestheamountoftimethePWMoutputishigh.ADutyCycleof0correspondstoa0Voutput,andaDutyCycleof255correspondstoapulsetrainthatishighfor255/256=99.6%ofthetime.UsetheConfigurePWMOutputVItosetthefrequencyofthePWMoutputsignal.
YoucansettheDutyCyclebeforeorafterconfiguringaPWMoutput.Bydefault,theDutyCycleis0,soifyoucalltheConfigurePWMOutputVItoconfigureaPWMoutput,theoutputislowuntilyousettheDutyCycledifferently.IfyousettheDutyCyclefirst,thePWMoutputreflectsthisDutyCycleimmediatelyaftercallingtheConfigurePWMOutputVI.
NoteIfyouaredoingonboardprogrammingandareusingInpVecttogetthedatathisVIneeds,rememberthatthisVIreadsthevariablesstartingatthememoryaddresspointedtobyInpVectinthefollowingorder:PWMOutput,DutyCycle.
ReadADCsReadstheconvertedvaluefromanADCinputchannel.
Details
DeviceCompatibility
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.ADCistheAnalog-to-DigitalConverterchanneltoread.ValidADCresourcesare0x51(81)through0x5F(95).RetVectindicatesthedestinationforthereturndatageneratedbythisVI.Availablereturnvectorsincludereturndatatothehost(0xFF),returndatatoavariable(0x01through0x78),returndatatoanindirectvariable(0x81through0xF8),anddonotreturndata(0).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroora
UsingThisVI
TheReadADCVIreturnstheconvertedvoltagefromanyoftheanaloginputchannels.YoucanonlyreadvaluesfromchannelsthathavebeeneitherdirectlyenabledbytheEnableADCsVIorautomaticallyenabledbybeingmappedtoanenabledaxis.
ForanADCchannelmappedtoanaxis,thisVIreturnstheactualADCvalue.Incontrast,theReadPositionVIexecutedontheowneraxisreturnsanADCvaluethathasbeenoffsetbyaresetvaluestoredwhentheResetPositionVIwasexecuted.ADCchannelsareneverinternallyresetsotheirDCvaluesarepreserved.
ReadI/OPortReadsthelogicalstateofthebitsinanI/Oport.
DetailsRemarks
DeviceCompatibility
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.Port(1)isthegeneral-purposeI/Oport(1–8)orRTSIsoftwareport(9)toread.RetnVectindicatesthedestinationforthereturndatageneratedbythisVI.Availablereturnvectorsincludereturndatatothehost(0xFF),toavariable(0x01through0x78),toanindirectvariable(0x81through0xF8),anddonotreturndata(0).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroora
UsingThisVI
TheReadI/OPortVIreadsthelogicalstateofthebitsinthegeneral-purposeI/Oportselected.YoucanexecutethisVIatanytimetomonitorthesignalsconnectedtoaninputport.ReadsofportsconfiguredasoutputsreturnthelastvaluewrittentotheportwiththeSetI/OPortMOMOVI.
NoteThisVIreadsthelogicalstate(OnorOff,TrueorFalse)ofthebitsinaport.ThepolarityofthebitsintheportdetermineswhetheranOnstateisactivehighoractivelow.RefertotheSetI/OPortPolarityVIformoreinformation.NoteRefertoVIExecutionTimesforbenchmarktiminginformationaboutyourcontroller.
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NI73xxControllerConsiderations
ThefollowingincludesconsiderationsyoumustmakewhenyouareusingthisVIwitha73xxcontroller:
ThePCI-7390hasdedicateddirectionI/Oports.Referto73xxControllerGeneral-PurposeI/OPortIDsfortheappropriateportnumbertouseforPort.
Forexample,toreadthestateofinputport3,Portis0x03(3).Toreadthevaluepreviouslysetonoutputport2,Portis0x82(130)WhenreadingtheRTSIport,thevaluereadisthelatcheddata,soyoucandetectactivepulsesontheRTSIbus.Afterreadingthelatcheddatavalue,theVIresetsthelatch.UsetheSetI/OPortPolarityVItospecifythepolarity—andthereforetheactivestate—forlatching.
NISoftMotionControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwiththeNISoftMotionController:
TheNISoftMotionControllerhasdedicateddirectionI/Oports.RefertoNISoftMotionControllerGeneral-PurposeI/OPortIDsfortheappropriateportnumbertouseforPort.
Forexample,toreadthestateofoutputport2,Portis0x82(130).Toreadthestateofinputport3,Portis0x03(3).TheRTSIportisnotsupportedbytheNISoftMotionController.
ResetEncoderPositionResetsthepositionofanunmappedencodertothespecifiedvalue.
Details
DeviceCompatibility
ResetPosition(0)istheresetvaluefortheencoderresource.Youcanresetpositiontoanyvalueinthetotalpositionrangeof-(231)to+(231–1).BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.Encoderisencodertoreset.InpVectindicatesthesourceofthedataforthisVI.Availableinputvectorsincludeimmediate(0xFF),variable(0x01through0x78),orindirectvariable(0x81through0xF8).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.If
UsingThisVI
TheResetEncoderPositionVIresetsthepositionoftheselectedencoder.Youcanresetpositiontozeroortoanyvalueinthe32-bitpositionrange.Normally,thisVIisonlyusedonindependentencodersthatarenotmappedtoaxes.Forencodersmappedtoaxes,usetheResetPositionVIinstead.
NoteAttemptingtoresetanencoderthatismappedtoanaxisgeneratesanerror.
EnabledbreakpointsarealsoautomaticallydisabledwhenyouexecuteResetEncoderPositiononthecorrespondingaxis.
Encoderpositioncanberesetatanytime.However,itisrecommendedthatyouresetpositiononlywhiletheencoderisstopped.Anencoderresetwhileitismovingdoesnothavearepeatablereferenceposition.
NoteNon-zeroresetvaluesareusefulfordefiningapositionreferenceoffset.
SelectSignalSpecifiesthesourceanddestinationforvariousmotionsignals:
triggerinputshigh-speedcapturecircuitsbreakpointoutputs
RTSIlinesRTSIsoftwareports
Details
DeviceCompatibility
SourceisthesourceofthesignaltoroutetoDestination.
ForaDestinationvalueofHigh-speedCapture[1..8],thevalidSourcevaluesareasfollows.
Source CommentsRTSI[0..7] RTSIlines0through7PXIStarTrigger PXIstartriggerlineTriggerInput Triggerinputforthecorrespondingaxis
NoteYoumustroutesignalsfromtheRTSIlinesbeforeyouenable
UsingThisVI
WhenthedestinationisRTSI[0..7]orPXIStarTrigger,themotioncontrollerdrivestheRTSIlineasanoutput.WhenthedestinationisHigh-speedCapture[1..8],theRTSIlineservesasaninputforthehigh-speedcapturecircuitry.ThisVIisusedtosetthedirectionoftheRTSIlines.TheRTSIlinescanalwaysbereadusingtheReadI/OPortVI,regardlessofthewaytheyarecurrentlyconfigured.
TomanuallysetthestateoftheRTSIlines,settheSourcefortheRTSIlinetobeRTSISoftwarePort.UsetheSetI/OPortMOMOVItosetthestateofthelines.
ThesignalseenontheRTSI4pinisahighpulseof120to150nsduration.TheactionspecifiedintheEnableBreakpointOutputVIonlyappliestothebreakpointoutputpinonthemotionI/Oconnector,nottoRTSIpins.
Example1
TousethesignalcominginonRTSIpin3totriggerthehigh-speedcaptureonencoder/axis1,connectDestinationtoHigh-SpeedCapture1andSourcetoRTSI3.
Thepolarityofthehigh-speedcaptureinputisspecifiedbytheConfigureHigh-SpeedCaptureVI.
Example2
Tooutputthebreakpointsignalforaxis2onRTSIpin4,connectDestinationtoRTSI4andSourcetoBreakpoint2.
Example3
TodriveRTSIpin5withthecorrespondingbit(bit5)oftheRTSIsoftwareport,connectDestinationtoRTSI5andSourcetoRTSISoftwarePort.TosetthestateoftheRTSIsoftwareport,usetheSetI/OPortMOMOVI.
SetADCRangeSetsthevoltagerangefortheanalogtodigitalconverters,onaper-channelbasis.
Details
DeviceCompatibility
Range(–10to+10)specifiestheinputvoltagerangeoverwhichtheADCconvertsinputvoltagestodigitalvalues.Voltagesoutsideoftherangeclampsattheextremes,whichare–2048or+2047(7330/40)and–32,768to+32,767(7350)forthe–5to+5Vand–10to+10Vranges,and0to4,096(7330/40)and0to+65,535(7350)forthe0to+5Vand0to+10Vranges.Youcanchoosefromthefollowingvaluesfortherange:
BinaryValuesRangeValues 7350 7330/400to5 0to+65,535 0to+4,095–5to+5 –32,768to+32,767 –2,048to+2,0470to+10 0to+65,535 0to+4,095–10to+10(default) –32,768to+32,767 –2,048to+2,047BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.ADCistheanalog-to-digitalconverterchanneltoconfigure.ValidADCresourcesare0x51through0x5F.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIruns
UsingThisVI
IfyoudonotcallthisVI,therangedefaultsto–10to+10V.Ifyouknowthattheinputvoltagefallswithinamorerestrictiverange,youcaneffectivelyincreasetheresolutionofthemeasurementsbyselectinganappropriaterangefromthepreviouslist.
NoteWiththe7350motioncontroller,changingtherangeofanADCchangesallotherADCstothesamerange.OtherNImotioncontrollerscansettherangeindependentofotherADCs.
Forexample,ifyouareusinga7340motioncontroller,theinputsignalrangesfrom–3to+3V,andyouselectthe–5to+5Vrange,the4,096discretevaluesfortheADCare2.44mVapartinsteadofthe4.88mVapartwhenusingthe–10to+10Vrange.Ifyouareusinga7350motioncontroller,theinputsignalrangesfrom–3to+3V,andyouselectthe–5to+5Vrange,the65,536discretevaluesfortheADCare152µVapartinsteadofthe305µVapartwhenusingthe–10to+10Vrange.
ADCrangescannotbechangedonanyADCwhileanaxisthatisusinganalogfeedbackisenabled.Youmustfirstdisabletheaxisusinganalogfeedback,thenchangetherange.
Formoreinformation,refertotheReadADCsandEnableADCsVIs.
SetI/OPortDirectionSetsthedirectionofageneral-purposeI/Oportasinputoroutput.
Details
DeviceCompatibility
Direction(Input)isthebitmapofdirectionsforthebitsintheI/Oport:IfDirectionBit0isTRUE(default)thebitissettoinput.IfitisFALSEthebitissettooutput.IfDirectionBit1isTRUE(default)thebitissettoinput.IfitisFALSEthebitissettooutput.IfDirectionBit2isTRUE(default)thebitissettoinput.IfitisFALSEthebitissettooutput.IfDirectionBit3isTRUE(default)thebitissettoinput.IfitisFALSEthebitissettooutput.IfDirectionBit4isTRUE(default)thebitissettoinput.IfitisFALSEthebitissettooutput.IfDirectionBit5isTRUE(default)thebitissettoinput.IfitisFALSEthebitissettooutput.IfDirectionBit6isTRUE(default)thebitissettoinput.IfitisFALSEthebitissettooutput.IfDirectionBit7isTRUE(default)thebitissettoinput.IfitisFALSEthebitissettooutput.
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfrom
UsingThisVI
TheSetI/OPortDirectionVIconfiguresthebitsinageneral-purposeI/Oportasinputoroutput.Aftersettingthedirection,usetheReadI/OPortVItoreadtheport,theSetI/OPortMOMOVItowritetotheport,andtheSetI/OPortPolarityVItosetthepolarityofeachbitintheporttoactivehighoractivelow.
NoteThedirectionofbitsintheRTSIsoftwareport(port9)iscontrolledwiththeSelectSignalVI.
SetI/OPortMOMOSetsanI/OportvalueusingtheMustOn/MustOffprotocol.
DetailsRemarks
DeviceCompatibility
MustOffisthebitmapofI/Oportbitstoforceoff.BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.MustOnisthebitmapofI/Oportbitstoforceon.InpVectindicatesthesourceofthedataforthisVI.Availableinputvectorsincludeimmediate(0xFF),variable(0x01through0x78),orindirectvariable(0x81through0xF8).RefertoInputandReturnVectorsformoredetailedinformation.Port(1)isthegeneral-purposeI/Oport(1–8)orRTSIsoftwareport(9)tocontrol.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.If
UsingThisVI
TheSetI/OPortMOMOVIsetsthelogicalstateofbitsinthegeneral-purposeI/Oportselected.
UsingtheMustOn/MustOffprotocolallowsyoutosetorresetindividualbitswithoutaffectingotheroutputbitsintheport.Thisgivesyoutri-statecontrolovereachbit:on,offorunchanged.ATrueinabitlocationoftheMustOnbitmapturnsthebiton,whileaTrueinthecorrespondinglocationoftheMustOffbitmapturnsthebitoff.AFalseineitherbitmaphasnoeffect,soleavingboththeMustOnandMustOffbitsatzeroiseffectivelyaholdandthestateofthebitisunchanged.IfyousetboththeMustOnandMustOffbitstoTrue,itisinterpretedasaMustOnconditionandthebitisturnedon.
NoteThisVIsetsthelogicalstateofabitOnorOff(TrueorFalse).ThepolarityofthebitsintheportdetermineswhetheranOnstateisactivehighoractivelow.RefertothePortPolarityVIformoreinformation.NoteWhenexecutingtheSetI/OPortMOMOVIinaLabVIEWprogram,theremaybeadelayofupto0.5msbeforetheoutputlinesarephysicallyupdated.TheLabVIEWprogramflowcontinues,eventhoughtheoutputmaynotbeupdatedyet.NoteIfthemotioncontrollerisprogrammedtousetheportforoutputwhenithasbeenconfiguredforinput,theactionisignored.
TheSetI/OPortMOMOVIallowsindividualcontrolofgeneral-purposeoutputbitswithoutrequiringashadowvalueorareadoftheporttorememberthestateofotherbitsnotbeingsetorresetwiththeVI.
Example
TipThissectionappliestoallNImotioncontrollers.
InI/Oport2,tosetbits1and3On,bits0and5Off,andtoleavetheotherbits(2,4,6,and7)unchanged,callthisVIwiththefollowingparameters:
Port=2MustOncorrespondstothevaluesshowninthefollowingtable.
MustOn0 MustOn1 MustOn2 MustOn3 MustOn4 MustOn5 MustOn6
UsingThisVI
TheSetI/OPortMOMOVIsetsthelogicalstateofbitsinthegeneral-purposeI/Oportselected.
UsingtheMustOn/MustOffprotocolallowsyoutosetorresetindividualbitswithoutaffectingotheroutputbitsintheport.Thisgivesyoutri-statecontrolovereachbit:on,offorunchanged.A
inabitlocationoftheMustOnbitmapturnsthebiton,whileaTrueinthecorrespondingMustOffbitmapturnsthebitoff.AFalseineitherbitmaphasnoeffect,soMustOnandMustOffbitsatzeroiseffectivelyaholdandthestateofthebit
isunchanged.IfyousetboththeMustOnandMustOffbitstoTrue,itisinterpretedasaMustOnconditionandthebitisturnedon.
ThisVIsetsthelogicalstateofabitOnorOff(TrueorFalse).ThepolarityofthebitsintheportdetermineswhetheranOnstateisactivehighoractivelow.RefertotheSetI/O
VIformoreinformation.WhenexecutingtheSetI/OPortMOMOVIinaLabVIEWprogram,theremaybea
delayofupto0.5msbeforetheoutputlinesarephysicallyupdated.TheLabVIEWprogramflowcontinues,eventhoughtheoutputmaynotbeupdatedyet.
Ifthemotioncontrollerisprogrammedtousetheportforoutputwhenithasbeenconfiguredforinput,theactionisignored.
TheSetI/OPortMOMOVIallowsindividualcontrolofgeneral-purposeoutputbitswithoutrequiringashadowvalueorareadoftheporttorememberthestateofotherbitsnotbeingsetorresetwiththeVI.
ThissectionappliestoallNImotioncontrollers.
InI/Oport2,tosetbits1and3On,bits0and5Off,andtoleavetheotherbits(2,4,6,and7)unchanged,callthisVIwiththefollowingparameters:
correspondstothevaluesshowninthefollowingtable.
MustOn1 MustOn2 MustOn3 MustOn4 MustOn5 MustOn6 MustOn7
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NI73xxControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwitha73xxmotioncontroller:
AlineconfiguredforinputisnotaffectedbythisVI.YoucanalwayswritetotheRTSIsoftwareport,buttheactualRTSIlinesonthephysicalRTSIportareonlyaffectediftheRTSIlinehasbeenconfiguredproperlybyusingtheSelectSignalVI.Bydefault,noneoftheRTSIlinesareconfiguredtooutputtheircorrespondingbitsintheRTSIsoftwareport;youmustconfigureeachRTSIlineindividuallyusingtheSelectSignalVI,ratherthantheSetI/OPortDirectionVI.ThePCI-7390hasdedicateddirectionI/Oports.Referto73xxControllerGeneral-PurposeI/OPortIDsfortheappropriateportnumbertouseforPort.
Forexample,tosetthestateofoutputport2,Portis0x82(130).Tosetthestateofinputport3,Portis0x03(3).
NISoftMotionControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwiththeNISoftMotionController:
RefertoGeneral-PurposeI/OPortsforinformationabouthowtheNISoftMotionControllersupportsdigitalinputandoutputlinesforeachaxis.ForInpVect,theNISoftMotionControllersupportsonlytheimmediatevector(0XFF).TheNISoftMotionControllerhasdedicateddirectionI/Oports.RefertoNISoftMotionControllerGeneral-PurposeI/OPortIDsfortheappropriateportnumbertouseforPort.
SetI/OPortPolaritySetsthebitpolarityinageneral-purposeI/Oport.
DetailsRemarks
DeviceCompatibility
IOPolarityisthebitmapofactivepolaritiesfortheI/Oport:IfIOPolarityBit0isTRUE(default)thebitissettoactivelow/activeopen.IfitisFALSEthebitissettoactivehigh/activeclosed.IfIOPolarityBit1isTRUE(default)thebitissettoactivelow/activeopen.IfitisFALSEthebitissettoactivehigh/activeclosed.IfIOPolarityBit2isTRUE(default)thebitissettoactivelow/activeopen.IfitisFALSEthebitissettoactivehigh/activeclosed.IfIOPolarityBit3isTRUE(default)thebitissettoactivelow/activeopen.IfitisFALSEthebitissettoactivehigh/activeclosed.IfIOPolarityBit4isTRUE(default)thebitissettoactivelow/activeopen.IfitisFALSEthebitissettoactivehigh/activeclosed.IfIOPolarityBit5isTRUE(default)thebitissettoactivelow/activeopen.IfitisFALSEthebitissettoactivehigh/activeclosed.IfIOPolarityBit6isTRUE(default)thebitissettoactive
UsingThisVI
TheSetI/OPortPolarityVIsetsthepolarity(activestate)ofthegeneral-purposeI/Oportonanindividualbitbasis.
Whenconfiguredasactivelow,theinputoroutputisactivewhenthereisalowsignalonthepin.Conversely,activehighmeansthattheinputoroutputisactivewhenthereisahighsignalonthepin.
Configuringanactivestateofactiveopenoractivecloseddoesnotcorrespondtothelevelofthesignalontheinputoroutputpin.Instead,anactiveopenstatemeansthattheinputoroutputisactivewhencurrentisnotflowingthroughtheoptocoupledinput.Conversely,anactiveclosedstatemeansthattheinputoroutputisactivewhencurrentisflowingthroughtheoptocoupledinput.
Typically,portsandtheirpinsareconfiguredfordirectionandpolarity(activestate)atinitialization.Afterconfiguration,youcanthenreadorwritelogicalstates(TrueorFalse,OnorOff)toportswithoutworryingaboutthephysicalstatesofsignalsontheportpins.
NoteRefertoVIExecutionTimesforbenchmarktiminginformationaboutyourcontroller.
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NI73xxControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwitha73xxmotioncontroller:
ThepolarityalsodefinesthelatchingbehaviorfortheRTSIport.InordertodetectshortpulsesonRTSIlines,thehardwarelatchesactive-goingsignalsandholdsthatstateuntiltheportisread.Forexample,ifyouconfigureabitforactivelowpolarity,atransitionfromhightolowislatcheduntilread,evenifthesignalgoeshighagain.Ifthesignalstartslow,itisalsolatcheduntilread,evenifthesignalishighwhenyoureadthebit.ThePCI-7390hasdedicateddirectionI/Oports.Referto73xxControllerGeneral-PurposeI/OPortIDsfortheappropriateportnumbertouseforPort.
Forexample,toconfigurethepolarityoftheoutputportonaxis2,Portis0x82(130).Toconfigurethepolarityoftheinputportonaxis3,Portis0x03(3).
NISoftMotionControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwiththeNISoftMotionController:
TheNISoftMotionControllerhasdedicateddirectionI/Oports.RefertoNISoftMotionControllerGeneral-PurposeI/OPortIDsfortheappropriateportnumbertouseforPort.
Forexample,toconfigurethepolarityoftheoutputportonaxis2,Portis0x82(130).Toconfigurethepolarityoftheinputportonaxis3,Portis
Error&UtilityVIsYoucanusetheerrorhandlingVIsandutilityVIstogetinformationaboutthemotioncontroller.RefertoErrorsandErrorHandlingformoreinformationabouterrors.
ClicktheiconsforVIdescriptions.
GetMotionBoardInformation
Getu32
Setu32
SelectResource
SelectMOMO
MotionErrorHandler
ErrorMonitor
Subpalette
AdvancedError&UtilityVIs
ErrorMonitorDisplaystheerrorsreturnedbytheNI-Motionsoftwareandcontroller.
Details
DeviceCompatibility
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.stopisusedtocontrolthemonitoringprocess.BdIDOutisprovidedforflowcontrol.YoucanstringtogetherNI-MotionVIsbywiringtheBdIDOutterminalofoneVItotheBoardIDterminalofthenextVI.
UsingThisVI
ThisVIcanbemadetoruncontinuouslyinthebackgroundasaseparateVItomonitorthemotioncontrollerforerrors.
GetMotionBoardInformationGetsinformationaboutthepropertiesandfeaturesofthemotioncontroller.
DetailsRemarks
DeviceCompatibility
Desiredinformationrepresentsthetypeofinformationyouwanttoretrieveaboutthemotioncontroller.Thefollowingtablehasacompletelistofinformationvalues,aswellasoutputparametersrelevantforeachtypeofinformationreturned.
DesiredInformation
RelevantOutputTerminal
PossibleOutputValues
BoardFamily(0)
Numericout,Valueout
NI-MotionFamily(0)
BoardName(1)
Stringout Nameofcontroller
PCI_7344(28)PXI_7344(27)PCI_7342(37)
PCI_7340(61)PXI_7340(62)
UsingThisVI
ThisVIreturnsselectedinformationaboutNImotioncontrollersincludingcontrollertypeandfamily,bustype,numberofaxes,andsoon.
NI-MotionalsohasfourinformationtypesforretrievingtheversionnumbersandreleasedatesofthefirmwaresegmentsloadedintheonboardFlashROM.AllfirmwaresegmentsarefieldupgradableusingtheUpdateFirmwareoptioninMeasurement&AutomationExplorer.Versionsarereturnedinaversion-buildcodeformat:
Version-buildcode=MMmmbbbb,whereMMisthemajorversionnumber,mmistheminorversionnumber,andbbbbisthebuildnumber.
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NISoftMotionControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwiththeNISoftMotionController:
TheNISoftMotionControllerdoesnotsupportthefollowingenumerationsfortheDesiredInformationparameter:
FirmwareVersionDSPVersionFPGAVersionFPGA2Version
Getu32Getsthegeneralsoftwaresettings.
Details
DeviceCompatibility
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.ResourceistheAxis,VectorSpace,ADC,orEncoderyouwiredintotheVI.UseResourceOutputtopasstheresourcetoanotherVIand/ortodisplayinformationaboutthedevice.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.UsetheerrorhandlerVIstolookupthemeaningofthiscodeanddisplaythecorrespondingerrormessage.sourceisastringthatindicatestheoriginoftheerror,ifany.Typically,sourceisthenameoftheVIinwhichtheerroroccurred.
Attributeistheselectorforthetypeofinformationyouwanttoretrieve.
UsingThisVI
TheGetu32VIreturnsselecteddataaboutsoftwaresettings.ThisVIcanretrievevaluesstoredinintegerformat.
Attribute Resource Description PossibleValues
BreakpointWindow
Axisorencoder
Aftertheaxisencountersabreakpoint,theaxismustmoveoutsidethebreakpointwindowbeforeitcanrearmforanotherbreakpoint.Thisisusedtopreventoscillationfromsendingmultiplebreakpointoutputsfromthesamebreakpointposition.Thedefaultis0.
0to255
ProgramAutoStart N/A
Usethisattributetoreturntheonboardprogramthatisenabledforautostart. —
GearingEnableStatus
Axiscontroloraxis
Usethisattributetoreadthegearingenablestatusonanindividualaxisoronaxesonethrougheightusingtheaxiscontrolresource.Readingthestatusonaxesonethrougheightreturnsabitmapwherebit0isthestatusforaxis1andsoon.Readingthestatusonanindividualaxisreturnsabitmapthatismaskedforthataxis.
Foreachbitinthebitmap:1=gearingenabled0=gearingdisabled
UsingUnlistedResources
CompletethefollowingstepstousethisVIonresourcesthatarenotinthedrop-downlist:
1. OpentheVIinLabVIEW.2. Viewtheblockdiagram.3. Right-clicktheResourceterminalandselectCreate»Constant.4. Clickthedrop-downarrowontheResourceconstantandselectOther.
MotionErrorHandlerChecksformodalerrorsonthecontroller.
Details
DeviceCompatibility
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.UsetheerrorhandlerVIstolookupthemeaningofthiscodeanddisplaythecorrespondingerrormessage.sourceisastringthatindicatestheoriginoftheerror,ifany.Typically,sourceisthenameoftheVIinwhichtheerroroccurred.
UsingThisVI
IfthemodalerrorseverityinputisTRUE(error),modalerrorsaretreatedaserrors.Thefirstmodalerroristhenpassedoutthroughtheerroroutterminal.IfthisinputisFALSE(warning),modalerrorsaretreatedaswarnings.
WhenusingsubVIsthatincorporatetheerrorin/errorout(orerrorI/O)structure,placethishandlerwhereyouwanttoinformtheuserofanerror,typicallyattheendoftheI/Odatapath,asthelastactionoftheprogram.IftheerrorinstatusisTRUE(aredX),thehandlercreatesamessagedescribingtheerroranditssource.
IftheTypeofDialoginputis1(default),themessageisdisplayedtotheuser,whocanonlyacknowledgeit.Ifthisinputis2,theusercanacknowledgethemessageorabortexecution.Iftheinputis0,nomessageisdisplayed;usethisvaluetoprocesstheerrorprogrammatically.
ThisVIalwayschecksformodalerrorsonthecontroller.IftheModalErrorSeverityinputisTRUE(error),modalerrorsaretreatedaserrors.Thefirstmodalerroristhenpassedoutthroughtheerroroutterminal.IfthisinputisFALSE(warning),modalerrorsaretreatedaswarnings.
IftheModalErrorRetrievalModeinputisTRUE(single),onlyonemodalerrorisreadfromthecontroller'serrorstack.IfthisinputisFALSE(all),allofthemodalerrorsonthecontrollerareread.ModalerrorsthatarereadfromthecontrollerareplacedintotheModalError(s)Outoutputarray.
SelectResourceThisutilityVIisusedtocombineresourceIDsfromanarrayintoasinglebitmap.
Details
DeviceCompatibility
ResourceistheAxis,VectorSpace,ADC,orEncoderyouwiredintotheVI.UseResourceOutputtopasstheresourcetoanotherVIand/ortodisplayinformationaboutthedevice.Bitmapisthebitmapcorrespondingtothecombinationoftheresourcesselected.
UsingThisVI
SelectResourceVIisusedtogenerateinputbitmapsforVIsthatoperateonmultipleresources.
ThisVIreturnsabitmapbasedontheresourceIDswiredin.Theorderoftheresourceswiredindoesnotmatter.Thetrue/falsestateofabitinthebitmapiscontrolledbytheresourceIDandnotbythewireposition.
ThisVIisusefulwhenusedwithStart,Stop,andBlendVIs.
SelectMOMOThisutilityVIisusedtocombineresourceIDsintoasinglebitmap.
Details
DeviceCompatibility
ResourceistheAxis,VectorSpace,ADC,orEncoderyouwiredintotheVI.UseResourceOutputtopasstheresourcetoanotherVIand/ortodisplayinformationaboutthedevice.MustOn/OffThebitmapcorrespondingtothecombinationoftheresourcesselectedinMustOn/MustOffformat.
UsingThisVI
SelectMOMOVIisusedtogenerateinputbitmapsforVIsthatusetheMustOn/MustOffformatprotocol.
ThisVIreturnsabitmapbasedontheresourceIDswiredin.Theorderoftheresourceswiredindoesnotmatter.Thetrue/falsestateofabitinthebitmapiscontrolledbytheresourceIDandnotbythewireposition.
ThisVIisusedtogenerateinputbitmapsforVIsthatusetheMustOn/MustOffformatprotocol.
Setu32Setsthegeneralsoftwaresettings.
Details
DeviceCompatibility
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.ResourceistheAxis,VectorSpace,ADC,orEncoderyouwiredintotheVI.UseResourceOutputtopasstheresourcetoanotherVIand/ortodisplayinformationaboutthedevice.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.UsetheerrorhandlerVIstolookupthemeaningofthiscodeanddisplaythecorrespondingerrormessage.sourceisastringthatindicatestheoriginoftheerror,ifany.Typically,sourceisthenameoftheVIinwhichtheerroroccurred.
Valueistheselectorforthetypeofdatayouwanttoset.
UsingThisVI
TheSetu32VIsetsselectedsoftwaresettingsasspecifiedbyAttribute.ThisVIcansetvaluesstoredinintegerformat.
Thefollowingtableshowstheattributesyoucanset,theirdescriptions,andpossiblevalues:
Attribute Resource Constant Description Values
BreakpointWindow
Axisorencoder 0x0200
Aftertheaxisencountersabreakpoint,theaxismustmoveoutsidethebreakpointwindowbeforeitcanrearmforanotherbreakpoint.Thisisusedtopreventoscillationfromsendingmultiplebreakpointoutputsfromthesamebreakpointposition.Thedefaultis0.
NoteThebreakpointwindowmustbesmallerthanthebreakpointmodulusorperiod.Amodalerrorisgeneratedwhenthebreakpointwindowislargerthantheloadedbreakpointmodulusorperiod.
0to255
Pull-inWindow Axis 0x0400
Forclosed-loopstepperaxes,anareaaroundthetargetpositionthatdetermineswhetherornottodoanymorepull-inmoves.Oncewithinthearea,themotioncontrollerstopsdoingpull-intries.Thedefaultis1.
0to32,767
Pull-inTries Axis 0x0401
Themaximumnumberoftimestheclosed-loopstepperaxistriestoreachthetargetposition.Itwilltryuntilitiswithintherangespecified 0to
32,767
UsingUnlistedResources
CompletethefollowingstepstousethisVIonresourcesthatarenotinthedrop-downlist:
1. OpentheVIinLabVIEW.2. Viewtheblockdiagram.3. Right-clicktheResourceterminalandselectCreate»Constant.4. Clickthedrop-downarrowontheResourceconstantandselectOther.5. Typetheappropriateresourcenumber,indecimal,fortheresourceyou
wanttoconfigure.RefertoAxes,VectorSpaces,ADCChannels,andEncodersforresourcenumbers.
6. Right-clicktheAttributeterminal,selectCreate»Constant,andselecttheappropriateattributefromthedrop-downlist.
AdvancedError&UtilityVIsClicktheiconsforVIdescriptions.
ReadErrorMessage
GetLastError
GetErrorDescription
GetErrorDescriptionGetsanerror,command,and/orresourcedescriptionstring.
Details
DeviceCompatibility
DescriptionType(Combined)istheselectorforthetypeofdescriptionstringtoreturn,asfollows:
Value Description0 ErrorOnly1 CommandNameOnly2 ResourceNameOnly3 CombinedDescriptionResourceIDistheresourceIDofanaxis,vectorspace,encoder,ADC,DAC,orotherresource.BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowing
UsingThisVI
TheGetErrorDescriptionVIreturnsastringdescriptionofanerror.YoucanusethisVItogenerateastringfordisplayingaVI'sname,aresource'sname,anerrorcodedescription,oracompleteerrordescriptionstringinresponsetoanerrorcodereturnedfromcallingtheReadErrorMessageVI.
Notallinputparametersarerequiredforeachdescriptiontype.Thefollowingparametersarerequiredtoreturnanaccuratedescriptionstring.
DescriptionType ErrorCode CommandID ResourceIDErroronly required notrequired notrequiredVInameonly notrequired required notrequiredResourcenameonly notrequired required requiredCombineddescription required required required
BecauseresourceIDsarenotunique(forexample,axis1andprogram1bothareresource1),theCommandIDisrequiredtosetthecontextandallowthisVItogeneratetheproperresourcenamestring.
GetLastErrorGetsdetailedinformationaboutthelasterrorgeneratedbyahigh-levelNI-MotionVIinthecourseofexecutingotherNI-MotionVIs.
Details
DeviceCompatibility
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.UsetheerrorhandlerVIstolookupthemeaningofthiscodeanddisplaythecorrespondingerrormessage.sourceisastringthatindicatestheoriginoftheerror,ifany.Typically,sourceisthenameoftheVIinwhichtheerroroccurred.
ResourceistheAxis,VectorSpace,ADC,orEncoderthatgeneratedthe
UsingThisVI
IftheInitializeControllerVIreturnsanerror,youcancalltheGetLastErrorVItodeterminethespecificNI-MotionVIandresourcegeneratingtheerror.YoucanthencalltheGetErrorDescriptionVI,whichformatsastringforyouwiththeVIname,resourceIDanderrordescription.
ReadErrorMessageReadsthemostrecentmodalerrorfromtheErrorMessageStack.
DetailsRemarks
DeviceCompatibility
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.UsetheerrorhandlerVIstolookupthemeaningofthiscodeanddisplaythecorrespondingerrormessage.sourceisastringthatindicatestheoriginoftheerror,ifany.Typically,sourceisthenameoftheVIinwhichtheerroroccurred.
ResourceistheAxis,VectorSpace,ADC,orEncoderyouwiredintothe
UsingThisVI
TheReadErrorMessageVIretrievesthemostrecentmodalerrorfromthecontrollerandreturnsthecommandIDandresourceIDthatcausetheerror,alongwiththeerrorcode.
NoteSeeErrorCodes,foradescriptionoferrorcodesandpossiblecauses.
Whenamodalerroroccurs,thecommandID,resourceID,anderrorcodeareautomaticallystoredinalast-infirst-outstackandtheErrorMessage(ErrMsg)bitintheCommunicationStatusRegisterissettoindicatethatoneormoreerrorsarepresentonthestack.
ModalerrorsaredefinedaserrorsthatarenotdetectedatthetimeofVIexecution.Foracompletedescription,refertoErrorsandErrorHandling.AcommonsourceofmodalerrorsisimproperlyconstructedVIcallsstoredinanonboardprogram.Whentheprogramisrun,theerrorsgeneratemodalerrormessages.
Becausetheerrormessagesarestoredinalast-in-first-out(LIFO)buffer,themostrecenterrorisavailableimmediately.YoucanreadoldererrorswithadditionalcallstothisVI.Whenthestackisempty,theErrorMessage(ErrMsg)bitintheCommunicationStatusRegisterisreset.YoucangetastringdescriptionoftheerrorbyusingtheGetErrorDescriptionVI.
Normally,iftheapplicationprogramisfunctioningcorrectly,errorsarenotgenerated.Readingtheerrormessagesfromtheboardisusefulduringdebuggingandforhandlingspecialconditions.
Example
AnapplicationprogramrunningonthehostcomputermonitorstheCommunicationStatusRegistertocheckforerrors.IftheErrorMessagebitisset,theprogramsendsaReadErrorMessageVItothecontrollerandthenreactstotheerrorinformationreturned.Dependinguponthetypeoferror
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NISoftMotionControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwiththeNISoftMotionController:
TheCommandIDreadinisalwayszero(0).TheerrorsstackisalwaysinFIFOmode.
OnboardProgrammingVIsYoucanuseOnboardProgrammingVIstoload,execute,andsaveonboardprograms.NI-MotionoffersasetofprogrammingVIsandfeaturesthatallowyoutowriteandcontrolautonomousprogramsthatarecompletelyindependentfromthehostcomputer.Youcanexecuteupto10onboardprogramssimultaneously.Thesizeandnumberofprogramsiscompletelyflexible.Itisultimatelylimitedbythe32totalmemoryobjectsintheObjectRegistryorbytotalavailablememory,whicheverisreachedfirst.RefertoBeginProgramStorageformoreinformation.Onboardprogramsruninatime-slicedmanner.RefertotheOnboardProgramssectionoftheNI-MotionHelpformoreinformation.
Onboardprogramssupportbasicmathanddataoperationfunctionsongeneral-purposevariables.Onboardprogramsalsoofferevent-basedVIssuchasJumptoLabelonConditionandWaitonCondition,whichallowyoutocontrolprogramexecution.Programscanevenstartandstopotherprograms.
Implementingpartorallofthemotionapplicationasanonboardprogramorprogramsoffloadsthehostcomputerfromhandlingthesereal-timeevents.Onboardprogramsalsocanisolatetheapplicationfromthehostcomputernon-real-timeoperatingsystem.Onlybuspowerisrequiredtocorrectlyexecuteanonboardprogramafteritisstarted.
ProgramscanberunfromRAMoroptionallysavedtonon-volatileFlashROM.Savedprogramsarethereforeavailableforexecutionatanyfuturetime,evenafterpowercycles.UsetheReadObjectRegistryVItodeterminethesizeofanonboardprogram.RefertoBufferedOperationsVIsforinformationaboutthetotalamountRAMandROMoneachcontroller.
OnboardProgrammingVIsincludeObjectManagementandDataOperationsVIs.YoucanuseOnboardProgrammingVIstobeginandendprogramstorageandtocontrolprogramexecution.YoucanuseObjectManagementVIstoorganize,annotate,andsaveprogramobjectstoROM.DataOperationsVIsincludebasicmathVIsanddataoperations.
SeveralVIsaretypicallyrunfromthehosttocontroltheonboardprogram
execution,suchastheRunProgram,Pause/Resume,andStopProgramVIs.Whenrunasahostcommand,theseVIsinterrupttheonboardprogramandchangetheprogramstatusaccordingly.
NoteTheOnboardProgrammingVIsarecompatiblewithNI7340/44andNI7350controllersonly.
ClicktheiconsforVIdescriptions.
BeginProgramStorage JumptoLabelonConditionEndProgramStorage SetUserStatusMOMORunProgram WaitonConditionPause/ResumeProgram LoadProgramDelayStopProgram ReadProgramStatusInsertLabel LoadProgramTimeSlice
Subpalettes
ObjectManagementVIs
DataOperationsVIs
BeginProgramStorageBeginsaprogramstoragesession.
Subsequentcallsarestoredaspartoftheonboardprogram.
Details
DeviceCompatibility
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.Program(1)istheonboardprogramtoreadthestatusof.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.UsetheerrorhandlerVIstolookupthemeaningofthiscodeanddisplaythecorrespondingerrormessage.sourceisastringthatindicatestheoriginoftheerror,ifany.Typically,sourceisthenameoftheVIinwhichtheerroroccurred.
UsingThisVI
TheBeginProgramStorageVIinitiatesprogramstorageinRAM.Aftertheybegin,allsubsequentVIsarestoredinanobjectbufferandnotexecuteduntiltheprogramisrunwiththeRunProgramVI.ThismemorystoragecontinuesuntilyouexecutetheEndProgramStorageVI.Youcanstoreonlyoneprogramatatime.
Thesizeandnumberofprogramsiscompletelyflexible.Itisultimatelylimitedbythe32totalmemoryobjectsintheObjectRegistryorbytotalavailablememory,whicheverisreachedfirst.
The7350and7340havethefollowingonboardmemory:
RAM ROM7340 164ksector 264ksectors7350 264ksectors 464ksectors
YoucanrunprogramsfromeitherRAMorROM,butyoucannotsplitprogramsbetweenthetwo,andyoucannotsplitprogramsbetweenthetwo64KBROMsectors.Withanaveragecommandsizeof10bytes,asingleprogramcanbeaslargeas6,400commands.Asanotherexample,the7350and7340controllerscanexecute10programssimultaneously,fivefromRAMandfivefromROM,witheachprogramupto1,280commandslong.
Notes
Attemptingtostoremorethan32programsgeneratesanerror.Similarly,anerrorisgeneratedifyourunoutofmemoryduringprogramstorage.Bothofthesecasesareextremelyunlikely.DonotstoreonboardprogramswhileotherNI-MotionVIsarerunning.Doingsocanresultinincorrectprogramstorage.Topreventunexpectedinterference,otherapplicationsrunningwithdifferentprocessesarenotabletocommunicatewiththecontrollerduringprogramstorage.
EndProgramStorageEndsaprogramstoragesession.
Details
DeviceCompatibility
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.Program(1)istheonboardprogramtoreadthestatusof.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.UsetheerrorhandlerVIstolookupthemeaningofthiscodeanddisplaythecorrespondingerrormessage.sourceisastringthatindicatestheoriginoftheerror,ifany.Typically,sourceisthenameoftheVIinwhichtheerroroccurred.
BdIDOutisprovidedforflowcontrol.YoucanstringtogetherNI-MotionVIsbywiringtheBdIDOutterminalofoneVItotheBoardID
UsingThisVI
TheEndProgramStorageVIendsmemorystorageoftheprogram.AllsubsequentVIsareexecutednormally.Youcansaveaprogramtonon-volatilememory(ROM)usingtheObjectMemoryManagementVI.
ThisVImaytakelongerthan62mstoprocess,soitisnotguaranteedtobecompatiblewithreal-timeexecution.
InsertLabelInsertsalabelinaprogram.
Details
DeviceCompatibility
LabelNumber(1)isanyarbitrarylabelnumberfrom1to65,535.BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.UsetheerrorhandlerVIstolookupthemeaningofthiscodeanddisplaythecorrespondingerrormessage.sourceisastringthatindicatestheoriginoftheerror,ifany.Typically,sourceisthenameoftheVIinwhichtheerroroccurred.
BdIDOutisprovidedforflowcontrol.YoucanstringtogetherNI-MotionVIsbywiringtheBdIDOutterminalofoneVItotheBoardIDterminalofthenextVI.erroroutcontainserrorinformation.Iferrorinindicatesanerror,error
UsingThisVI
TheInsertProgramLabelVImarksalocationinthesequenceofaprogram.ThelabelnumberidentifiesthislocationandusesitintheJumptoLabelonConditionVI.Labelnumbersarearbitraryanddonothavetofollowanumericalsequence.
JumptoLabelonConditionInsertsaconditionaljumpinaprogram.
Details
DeviceCompatibility
MustOff(False)isthebitmapofbitsthatmustbeFalsetosatisfythecondition:
MustOn0—Iftrue,bitmustbefalse.Iffalse,donotcare(default).MustOn1—Iftrue,bitmustbefalse.Iffalse,donotcare(default).MustOn2—Iftrue,bitmustbefalse.Iffalse,donotcare(default).MustOn3—Iftrue,bitmustbefalse.Iffalse,donotcare(default).MustOn4—Iftrue,bitmustbefalse.Iffalse,donotcare(default).MustOn5—Iftrue,bitmustbefalse.Iffalse,donotcare(default).MustOn6—Iftrue,bitmustbefalse.Iffalse,donotcare(default).MustOn7—Iftrue,bitmustbefalse.Iffalse,donotcare(default).MustOn8—Iftrue,bitmustbefalse.Iffalse,donotcare(default).
MustOn(False)isthebitmapofbitsthatmustbeTruetosatisfythecondition:
MustOn0—Iftrue,bitmustbetrue.Iffalse,donotcare(default).MustOn1—Iftrue,bitmustbetrue.Iffalse,donotcare(default).MustOn2—Iftrue,bitmustbetrue.Iffalse,donotcare(default).MustOn3—Iftrue,bitmustbetrue.Iffalse,donotcare(default).
UsingThisVI
TheJumptoLabelonConditionVIcontrolstheflowofexecutioninastoredprogrambydefiningaconditionaljumptoanylabelwithintheprogram.InadditiontoconditioncodessetastheresultofapreviousdataoperationsVI,youcantestvirtuallyanyinstantaneousstatusofaxesorresourcestodecidewhethertojumpornot.
Therearetwodistinctgroupsofconditions.Thefirstgroup,conditions0through5,testtheresultofthemostrecentlogical,mathematical,ordatatransferoperationsVI.RefertotheDataOperationsVIsinformationaboutmathematicalordatatransferoperations.Theseconditioncodestestwhethertheresultofthelatestlogical,mathematical,ordatatransferVIislessthanzero,equaltozero,lessthanorequaltozero,greaterthanzero,notequaltozero,orgreaterthanorequaltozero.Fortheseconditions,theResource,MustOn,MustOff,andMatchTypeparametersarenotrequiredandtheirvaluesareignored.
NoteYoucanprogramunconditionaljumpsbysettingtheconditiontoTrue(6).
Thesecondgroup,conditions7andabove,testaspecificmulti-axis,multi-encoder,program,motionI/O,orgeneral-purposeI/Ostatus.Whereapplicable,youcanselecttheappropriateresourcewiththeresourceparameter.
ProgramCompleteissimilartothefirstconditiongroupinthatMustOn,MustOff,andMatchTypeparametersarenotrequiredandtheirvaluesareignored.Yousetresourceequaltotheappropriateprogramnumbertotest.ThebalanceoftheconditionsinthisgroupteststatusbitmapsandVIssimilartoeachotherasdescribedintheremainderofthissection.
TheMustOn,MustOff,andMatchTypeparametersworktogethertodefineabitmapofTrueandFalsebitsthatmustbematchedtosatisfythecondition.TheMatchTypeparameterallowsyoutoselectbetweenanORmatch,whereanymatchingbitissufficient,andanANDmatch,whereallstatusbitsmustmatchtheTrue/FalsebitmapdefinedbyMustOnandMustOff.
UsingtheMustOn/MustOffprotocolgivesyoutri-statecontrolovereachmatchbit:True,False,orDon'tcare.ATrueinabitlocationoftheMustOnbitmapsetsthematchbittoTrue,whileaTrueinthecorrespondinglocationoftheMustOffbitmapresetsthematchbittoFalse.AFalseineitherbitmaphasnoaffect,soleavingboththeMustOnandMustOffbitsatFalsedefinesthebitasdonotcare.IfyousetboththeMustOnandMustOffbitstoTrue,itisinterpretedasaMustOnconditionandthematchbitissettoTrue.
TheJumptoLabelonConditionVIcontrolstheflowofexecutioninastoredprogrambydefiningaconditionaljumptoanylabelwithintheprogram.InadditiontoconditioncodessetastheresultofapreviousdataoperationsVI,youcantestvirtuallyanyinstantaneousstatusofaxesorresourcestodecidewhetherto
Therearetwodistinctgroupsofconditions.Thefirstgroup,conditions0through5,testtheresultofthemostrecentlogical,mathematical,ordatatransferoperationsVI.RefertotheDataOperationsVIsformoreinformationaboutmathematicalordatatransferoperations.Theseconditioncodestestwhethertheresultofthelatestlogical,mathematical,ordatatransferVIislessthanzero,equaltozero,lessthanorequaltozero,greaterthanzero,notequaltozero,orgreaterthanorequaltozero.Fortheseconditions,theResource,MustOn,MustOff,andMatchTypeparametersarenotrequiredandtheirvaluesareignored.
YoucanprogramunconditionaljumpsbysettingtheconditiontoTrue(6).
Thesecondgroup,conditions7andabove,testaspecificmulti-axis,multi-encoder,program,motionI/O,orgeneral-purposeI/Ostatus.Whereapplicable,youcanselecttheappropriateresourcewiththeresource
ProgramCompleteissimilartothefirstconditiongroupinthatMustOn,MustOff,andMatchTypeparametersarenotrequiredandtheirvaluesareignored.Yousetresourceequaltotheappropriateprogramnumbertotest.ThebalanceoftheconditionsinthisgroupteststatusbitmapsandVIssimilartoeachotherasdescribedintheremainderofthissection.
TheMustOn,MustOff,andMatchTypeparametersworktogethertodefineabitmapofTrueandFalsebitsthatmustbematchedtosatisfythecondition.TheMatchTypeparameterallowsyoutoselectbetweenanORmatch,whereanymatchingbitissufficient,andanANDmatch,whereallstatusbitsmustmatchtheTrue/FalsebitmapdefinedbyMustOnandMustOff.
UsingtheMustOn/MustOffprotocolgivesyoutri-statecontrolovereachmatchbit:True,False,orDon'tcare.ATrueinabitlocationoftheMustOnbitmapsetsthematchbittoTrue,whileaTrueinthecorrespondinglocationoftheMustOffbitmapresetsthematchbittoFalse.AFalseineitherbitmaphasnoaffect,soleavingboththeMustOnandMustOffbitsatFalsedefinesthebitasdonotcare.IfyousetboththeMustOnandMustOffbitstoTrue,itisinterpretedasaMustOnconditionandthematchbitissetto
LoadProgramDelayLoadsadelayintoaprogramsequence.
Details
DeviceCompatibility
DelayValue(1ms)isthedelayinmilliseconds.Therangeisfrom1to231–1ms.BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.UsetheerrorhandlerVIstolookupthemeaningofthiscodeanddisplaythecorrespondingerrormessage.sourceisastringthatindicatestheoriginoftheerror,ifany.Typically,sourceisthenameoftheVIinwhichtheerroroccurred.
UsingThisVI
TheLoadProgramDelayVIsuspendsprogramexecutionforthenumberofmillisecondsloaded.Programexecutionresumesafterthedelay.Delayscanbeasshortasoneortwomillisecondsoraslongashundredsofhours.
LoadProgramTimeSliceSpecifiestheminimumtimeanonboardprogramhastorunperwatchdogperiod.
Details
DeviceCompatibility
TimeSlice(ms)istheexecutiontimefortheonboardprogramperwatchdogperiod.Defaultis2ms.BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.Programistheprogramnumber.Validprogramnumbersare1through255(0x01through0xFF).InpVectindicatesthesourceofthedataforthisVI.Availableinputvectorsincludeimmediate(0xFF),variable(0x01through0x78),orindirectvariable(0x81through0xF8).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,or
UsingThisVI
LoadProgramTimeSlicespecifiestheminimumtimeanonboardprogramhastorunperwatchdogperiod.
NoteThisVIcanonlyberunasapartofonboardprogram;thehostcannotchangethetimesliceofaprogramdirectly.
Somethingstorememberwhenchangingthetimesliceofanonboardprogram:
Atotalof20msisallowedforallrunningonboardprograms.Everyonboardprogramloadswithadefault2mstimesliceunlessLoadProgramTimeSliceisexecutedatthebeginningoftheonboardprogram.Thedefaultvalueof2msiscalculatedbasedonmaximum10onboardprogramsrunningsimultaneouslywithequaltimeslice.Youcanassigndifferenttimeslicesforeachstoredonboardprogramaslongasthetotaloftimeslicefortherunningonboardprogramdoesnotexceed20msatanygiventime.
Forexample,supposeyouhavethefollowingonboardprogramscurrentlystored:
1. Onboardprogram1,timeslice=10ms2. Onboardprogram2,timeslice=10ms3. Onboardprogram3,timeslice=5ms4. Onboardprogram4,timeslice=4ms5. Onboardprogram5,timeslice=1ms
Youcouldrunprograms1and2simultaneouslywithouterror,becausethetotaltimeslicesofthetworunningprogramsis20ms.Ifyouthenstartprogram3,anNIMC_invalidTimeSlicemodalerroroccursbecausethenewtotaltimesliceis25ms.Theavailabletimesliceforanonboardprogramalsodependsontheorderinwhichtheprogramsarerun,becauseauser-definedtimeslicetakeseffectonlywhentheonboardprogramactuallyruns,andnotwhenitisstored.
Pause/ResumeProgramPausesarunningprogramorresumesexecutionofapausedprogram.
Details
DeviceCompatibility
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.Program(1)istheonboardprogramtoreadthestatusof.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.UsetheerrorhandlerVIstolookupthemeaningofthiscodeanddisplaythecorrespondingerrormessage.sourceisastringthatindicatestheoriginoftheerror,ifany.Typically,sourceisthenameoftheVIinwhichtheerroroccurred.
UsingThisVI
ThePause/ResumeProgramVIsuspendsexecutionofarunningprogramorresumesexecutionofapausedprogram.
Aprogramcanpauseorresumeexecutionofanotherprogram,andalsocanpause(butnotresume)itself.
NotePausingaprogramdoesnotaffectamovealreadystartedandinprogress.ItdoesnotimplementaStopMotionVI.
Anyrun-time(modal)errorinaprogramautomaticallypausestheprograminadditiontogeneratingtheerrormessage.RefertotheReadErrorMessageVIandErrorsandErrorHandlingforinformationabouterrors.
AprogramalsocanautomaticallypauseifyouexecuteaStopMotionVIfromthehostcomputeronanaxisoraxesundercontroloftheonboardprogram.Inthesecases,theprogrampauseswhenitattemptstoexecuteaStartMotionorBlendMotionVIonthestoppedaxes.Thisautomaticpausealsoapplieswhenthestopisduetoalimit,home,softwarelimit,orfollowingerrorcondition.
Youcaneffectivelysingle-stepthroughanonboardprogrambyhavingtheprogrampauseaftereveryVI,andthenresumingtheprogramfromthehostcomputer.
Systemtimedoesnotpausewhenyoupauseaprogram.PausingmerelystopsthenextVIfromexecuting.ThismeansthatadelaycounterfromLoadProgramDelaykeepscountingdownevenwhiletheonboardprogramispaused.Forexample,ifyouloadbothadelayoffivesecondsandthenpausetheprogramfor10seconds,youhaveatotalofonly10secondsbeforeexecutionoftheonboardprogramresumes.
ReadProgramStatusReadsthestatusofanonboardprogram.
Details
DeviceCompatibility
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.Program(1)istheonboardprogramtoreadthestatusof.RetnVectindicatesthedestinationforthereturndatageneratedbythisVI.Availablereturnvectorsincludereturndatatothehost(0xFF),toavariable(0x01through0x78),toanindirectvariable(0x81through0xF8),anddonotreturndata(0).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,
UsingThisVI
YoucanusethisVItodeterminethestateofanonboardprogram.Youcanonlyreadthestateofotherprogramsfromanonboardprogram.
RunProgramRunsapreviouslystoredprogram.
Details
DeviceCompatibility
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.Program(1)istheonboardprogramtoreadthestatusof.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.UsetheerrorhandlerVIstolookupthemeaningofthiscodeanddisplaythecorrespondingerrormessage.sourceisastringthatindicatestheoriginoftheerror,ifany.Typically,sourceisthenameoftheVIinwhichtheerroroccurred.
BdIDOutisprovidedforflowcontrol.YoucanstringtogetherNI-MotionVIsbywiringtheBdIDOutterminalofoneVItotheBoardIDterminalofthenextVI.ResourceOutistheAxis,VectorSpace,ADC,orEncoderyouwiredinto
UsingThisVI
TheRunProgramVIinitiatesexecutionoftheVIsstoredintheselectedprogram.YoucanrunprogramsoutofeitherRAMorROM.Youcanrunuptoten(10)programssimultaneously.
Aprogramcanrunanotherprogrambutyoucannothaveaprogramrunitself.AttemptingtostorearecursiveRunProgramVIinaprogramgeneratesanerroranddoesnotstoretheVI.
SetUserStatusMOMOControlstheuserstatusbitsintheMCSregister.
Details
DeviceCompatibility
MustOffisthebitmapofuserstatusbitstoforceFalse:Motionstatusregister13—Iftrue,userstatusbitforcedfalse.Iffalse,userstatusbitunchanged(default).Motionstatusregister14—Iftrue,userstatusbitforcedfalse.Iffalse,userstatusbitunchanged(default).Motionstatusregister15—Iftrue,userstatusbitforcedfalse.Iffalse,userstatusbitunchanged(default).
MustOnisthebitmapofuserstatusbitstoforceTrue:Motionstatusregister13—Iftrue,userstatusbitforcedtrue.Iffalse,userstatusbitunchanged(default).Motionstatusregister14—Iftrue,userstatusbitforcedtrue.Iffalse,userstatusbitunchanged(default).Motionstatusregister15—Iftrue,userstatusbitforcedtrue.Iffalse,userstatusbitunchanged(default).
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralready
UsingThisVI
TheSetUserStatusMOMOVIcontrolstheupperthreebitsintheMCSregisterusingtheMustOn/MustOffprotocol.YoucanusethisVIinprogramstoreportspecialconditionsbacktothehostcomputerbysettingandresettingoneormoreofthesebits.RefertotheReadMoveCompleteStatusVIformoreinformationaboutusingtheMCSregisterforhigh-speedpolling.
UsingtheMustOn/MustOffprotocolallowsyoutosetorresetindividualuserstatusbitswithoutaffectingtheotheruserstatusbits.Thisgivesyoutri-statecontrolovereachbit:True,False,orUnchanged.ATrueinabitlocationoftheMustOnbitmapsetstheuserstatusbithigh,whileaTrueinthecorrespondinglocationoftheMustOffbitmapresetstheuserstatusbitlow.AFalseineitherbitmaphasnoaffect,soleavingboththeMustOnandMustOffbitsatzeroiseffectivelyahold,andthestateoftheuserstatusbitisunchanged.IfyousetboththeMustOnandMustOffbitstoTrue,itisinterpretedasaMustOnconditionandtheuserstatusbitissethigh.
Example
Afteraconditionaljumpinaprogram,youwanttheprogramtoflagthehostwithasuccesscode.ThiscanbeaccomplishedbystoringtheSetUserStatusMOMOwithMustOnandMustOffasfollows.
MustOn13 MustOn14 MustOn15True False TrueMustOff13 MustOff14 MustOff15False True False
Thisforcesuserstatusbits13and15Trueanduserstatusbit14low.AsubsequentpolloftheMCSregisterreturnsMoveCompleteStatuswiththerelevantbitssetasfollows.
Status13 Status14 Status15True False True
StopProgramStopsarunningprogram.
Details
DeviceCompatibility
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.Program(1)istheonboardprogramtostop.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.UsetheerrorhandlerVIstolookupthemeaningofthiscodeanddisplaythecorrespondingerrormessage.sourceisastringthatindicatestheoriginoftheerror,ifany.Typically,sourceisthenameoftheVIinwhichtheerroroccurred.
BdIDOutisprovidedforflowcontrol.YoucanstringtogetherNI-MotionVIsbywiringtheBdIDOutterminalofoneVItotheBoardIDterminalofthenextVI.ResourceOutistheAxis,VectorSpace,ADC,orEncoderyouwiredinto
UsingThisVI
TheStopProgramVIterminatesexecutionofarunningprogram.Youcannotresumeastoppedprogrambutyoucanre-runtheprogramfromthebeginning.
Aprogramcanstopanotherprogrambutyoucannothaveaprogramstopitself.AttemptingtostorearecursiveStopProgramVIinaprogramgeneratesanerroranddoesnotstoretheVI.
NoteStoppingaprogramdoesnotaffectamovealreadystartedandinprogress.ItdoesnotimplementaStopMotionVI.
WaitonConditionInsertsaconditionalwaitinaprogram.
Details
DeviceCompatibility
Timeout(1)isthewaittimeoutvaluein100millisecondincrements.Therangeis0to65,534.Ifyouspecifyatimeoutof65,535,itistreatedasaninfinitetimeout,andwillwaituntiltheconditionismet.MustOffisthebitmapofbitsthatmustbeFalsetosatisfythecondition:
MustOff0—Iftrue,bitmustbefalse.Iffalse,donotcare(default).MustOff1—Iftrue,bitmustbefalse.Iffalse,donotcare(default).MustOff2—Iftrue,bitmustbefalse.Iffalse,donotcare(default).MustOff3—Iftrue,bitmustbefalse.Iffalse,donotcare(default).MustOff4—Iftrue,bitmustbefalse.Iffalse,donotcare(default).MustOff5—Iftrue,bitmustbefalse.Iffalse,donotcare(default).MustOff6—Iftrue,bitmustbefalse.Iffalse,donotcare(default).MustOff7—Iftrue,bitmustbefalse.Iffalse,donotcare(default).MustOff8—Iftrue,bitmustbefalse.Iffalse,donotcare(default).
MustOnisthebitmapofbitsthatmustbeTruetosatisfythecondition:MustOn0—Iftrue,bitmustbetrue.Iffalse,donotcare(default).MustOn1—Iftrue,bitmustbetrue.Iffalse,donotcare(default).MustOn2—Iftrue,bitmustbetrue.Iffalse,donotcare(default).MustOn3—Iftrue,bitmustbetrue.Iffalse,donotcare(default).
UsingThisVI
TheWaitonConditionVIcontrolstheflowofexecutioninastoredprogram.Itsuspendsprogramexecutionandwaitsuntilthespecifiedconditionismetorthetimeoutexpires.Whentheconditionismet,programexecutionisresumedwiththenextVIaftertheWaitonCondition.Eventhoughtheprogramissuspended,theprogramstatusreadusingReadProgramStatusisstillrunning.
Ifthetimeoutexpiresbeforetheconditionismet,anerrorisgeneratedandtheprogramgoesintothepausedstate.RefertothePause/ResumeProgramVIforinformationaboutresumingapausedprogram.
Ifyousetatimeoutofzero,theconditionmustalreadybetrueoranerrorisgenerated.
Youcanwaitonvirtuallyanyinstantaneousstatusofaxes,encoders,programs,motionI/O,orgeneral-purposeI/O.Whereapplicable,youcanselectthespecifiedresourcewiththeresourceparameter.
WhenwaitingonaprogramwiththeProgramCompletedcondition,MustOn,MustOff,andMatchTypeparametersarenotrequiredandtheirvaluesareignored.Yousetresourceequaltotheprogramnumbertowaiton.ThebalanceoftheconditionsteststatusbitmapsandVIsimilartoeachotherasdescribedintheremainderofthissection.
TheMustOn,MustOff,andMatchTypeparametersworktogethertodefineabitmapofTrueandFalsebitsthatmustbematchedtosatisfythecondition.Dependingonthetypeofevent,theMustOnandMustOffbitmapsareeitheronebasedorzerobased.IftheeventistiedtoanI/Oportresourcethebitmapsstartatbit0tocorrespondwithline0onanI/Oport.Iftheeventistiedtoanaxis-basedresource,suchasanencoderoranaxis,thebitmapsstartatbit1tocorrespondwithaxis1.TheMatchTypeparameterallowsyoutoselectbetweenanORmatch,whereanymatchingbitissufficient,andanANDmatch,whereallstatusbitsmustmatchtheTrue/FalsebitmapdefinedbyMustOnandMustOff.
UsingtheMustOn/MustOffprotocolgivesyoutri-statecontrolovereach
DataOperationsVIsDataOperationVIsincludetheavailablemathVIsongeneral-purposevariables.Variablescanbeloaded,added,multiplied,ANDed,andsoonbeforebeingusedasdatainamotioncontrolVI.
General-purposevariablesare32bitslongandcanbeusedeithersigned(i32)orunsigned(u32).AllDataOperationVIsoperateon32-bitvaluesandreturn32-bitvalues.Youmustbecarefultoavoidoverflowandunderflowconditions.Forexample,multiplyingtwo32-bitvariablesandreturningtheresulttoa32-bitvariablemightoverflowandwraparound.
Smallersizeddataisrightalignedwithina32-bitvariable.BitwiselogicalVIsalwaysassumethisalignmentandreturnsimilarlyalignedresults.
ManyNI-MotionVIscantakeinputdatafromageneral-purposevariablebypointingtothevariablewiththeinputvectorparameter.Similarly,allreadVIscanreturndatatoageneral-purposevariablebyusingthereturnvectorparameter,refertoInputandReturnVectors.
AlldataoperationVIssetconditioncodes(lessthan,equaltoorgreaterthanzero)dependingontheresultoftheoperation.YourprogramcantesttheseconditionswiththeJumptoLabelonConditionVI.ExecutingadataoperationsVIwithareturnvectorofzero(0)tellstheprogramtosettheconditioncodeandthenthrowtheresultingdataaway.Inthisway,youcanuseallthedataoperationsVIsastestsforconditionalbranching.
YoucanuseindirectvariablesasvariableinputsorreturnvectorswithalldataoperationVIs.
ClicktheiconsforVIdescriptions.
AddVariables ExclusiveORVariablesSubtractVariables InvertVariableMultiplyVariables LogicalShiftVariableDivideVariables LoadConstanttoVariableANDVariables ReadVariableORVariables
AddVariablesAddsthevaluesinthetwovariablesandreturnstheresult.
Details
DeviceCompatibility
Var2isthevariableholdingthesecondoperand.Validinputsarevariables(0x01through0x78)andindirectvariables(0x81through0xF8).Var1isthevariableholdingthefirstoperand.Validinputsarevariables(0x01through0x78)andindirectvariables(0x81through0xF8).BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.RetVectindicatesthedestinationforthereturndatageneratedbythisVI.Availablereturnvectorsincludereturndatatothehost(0xFF),returndatatoavariable(0x01through0x78),returndatatoanindirectvariable(0x81through0xF8),anddonotreturndata(0).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.
UsingThisVI
TheAddVariablesVIaddsthevaluesinthetwovariablesandreturnstheresulttothedestinationspecifiedbytheRetVect.
V1+V2=Result
where:V1isthevalueatVar1.V2isthevalueatVar2.ResultisstoredinthelocationpointedtobyRetVect.
Theresultcanbereturnedtoanewvariableoroneofthetwoinputvariables,returnedtothehostcomputer,orthrownaway.Inallcasestheconditioncodesaresetaccordingtotheresultingvalue.Thisvalueiscomparedwith0,andtheappropriateconditioncodeisset:GREATERTHAN,LESSTHAN,orEQUALtozero.
NoteBecarefulwhenaddingtwolargevalues.Theresultcouldoverflowandwraparound.Noerrorgenerateswhenanoverflowoccurs.
ANDVariablesPerformsabitwiseANDofthevaluesinthetwovariablesandreturnstheresult. DeviceCompatibility
Var2isthevariableholdingthesecondoperand.Validinputsarevariables(0x01through0x78)andindirectvariables(0x81through0xF8).Var1isthevariableholdingthefirstoperand.Validinputsarevariables(0x01through0x78)andindirectvariables(0x81through0xF8).BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.RetVectindicatesthedestinationforthereturndatageneratedbythisVI.Availablereturnvectorsincludereturndatatothehost(0xFF),returndatatoavariable(0x01through0x78),returndatatoanindirectvariable(0x81through0xF8),anddonotreturndata(0).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,or
UsingThisVI
TheANDVariablesVIperformsabitwiselogicalANDofthevaluesinthetwovariablesandreturnstheresulttothedestinationspecifiedbytheRetVect.
V1ANDV2=Result
where:V1isthevalueatVar1.V2isthevalueatVar2.ResultisstoredinthelocationpointedtobyRetVect.
Theresultcanbereturnedtoanewvariableoroneofthetwoinputvariables,returnedtothehostcomputer,orthrownaway.Theresultingvalueiscomparedtozero,andtheappropriateconditioncodeisset:GREATERTHAN,LESSTHAN,orEQUALtozero.TheEQUALconditioncodeissetTrueiftheresultequalszero(allbitslow)andFalseifanybitisset.TheGREATERTHANandLESSTHANcodesarealsosetbutcanbeconfusingafterlogicalbitwiseoperations.
Example
IfthevaluesinVar1andVar2are0x00001234and0x0000EEEE,respectively,theresultofthebitwiseANDis0x00000224whichisNOTEQUALtozero.
DivideVariablesDividesthevalueinthefirstvariablebythevalueinthesecondvariableandreturnstheresult.
Details
DeviceCompatibility
Var2isthevariableholdingthesecondoperand.Validinputsarevariables(0x01through0x78)andindirectvariables(0x81through0xF8).Var1isthevariableholdingthefirstoperand.Validinputsarevariables(0x01through0x78)andindirectvariables(0x81through0xF8).BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.RetVectindicatesthedestinationforthereturndatageneratedbythisVI.Availablereturnvectorsincludereturndatatothehost(0xFF),returndatatoavariable(0x01through0x78),returndatatoanindirectvariable(0x81through0xF8),anddonotreturndata(0).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowing
UsingThisVI
TheDivideVariablesVIdividesthevalueinthefirstvariablebythevalueinthesecondvariableandreturnstheresulttothedestinationspecifiedbytheRetVect.
V1/V2=Result
where:V1isthevalueatVar1.V2isthevalueatVar2.ResultisstoredinthelocationpointedtobyRetVect.
Theresultcanbereturnedtoanewvariableoroneofthetwoinputvariables,returnedtothehostcomputerorthrownaway.Inallcasestheconditioncodesaresetaccordingtotheresultingvalue.Theresultingvalueiscomparedtozero,andtheappropriateconditioncodeisset:GREATERTHAN,LESSTHAN,orEQUALtozero.
NoteThisVIdoesanintegerdivideandtheremainderislost.NoteIfV2=0theVIreturnstheinvalidfunctiondatamodalerror(-70078).
ExclusiveORVariablesPerformsabitwiseExclusiveOR(XOR)ofthevaluesinthetwovariablesandreturnstheresult.
Details
DeviceCompatibility
Var1isthevariableholdingthefirstoperand.Validinputsarevariables(0x01through0x78)andindirectvariables(0x81through0xF8).Var2isthevariableholdingthesecondoperand.Validinputsarevariables(0x01through0x78)andindirectvariables(0x81through0xF8).BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.RetVectindicatesthedestinationforthereturndatageneratedbythisVI.Availablereturnvectorsincludereturndatatothehost(0xFF),returndatatoavariable(0x01through0x78),returndatatoanindirectvariable(0x81through0xF8),anddonotreturndata(0).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
UsingThisVI
TheExclusiveORVariablesVIperformsabitwiselogicalXORofthevaluesinthetwovariablesandreturnstheresulttothedestinationspecifiedbytheRetVect.
V1XORV2=Result
where:V1isthevalueatVar1.V2isthevalueatVar2.ResultisstoredinthelocationpointedtobyRetVect.
Theresultcanbereturnedtoanewvariableoroneofthetwoinputvariables,returnedtothehostcomputerorthrownaway.Theresultingvalueiscomparedtozero,andtheappropriateconditioncodeisset:GREATERTHAN,LESSTHAN,orEQUALtozero.TheEQUALconditioncodeissetTrueiftheresultequalszero(allbitslow)andFalseifanybitisset.TheGREATERTHANandLESSTHANcodesarealsosetbutcanbeconfusingafterlogicalbitwiseoperations.
Example
IfthevaluesinVar1andVar2are0x5A5A1234and0xFFFF4321,respectively,theresultofthebitwiseXORis0xA5A55115whichisNOTEQUALtozero.
InvertVariablePerformsabitwiseinversion(NOT)onthevalueinavariableandreturnstheresult.
Details
DeviceCompatibility
Var1isthelocationofthevariabletoinvert.Validinputsarevariables(0x01through0x78)andindirectvariables(0x81through0xF8).BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.RetVectindicatesthedestinationforthereturndatageneratedbythisVI.Availablereturnvectorsincludereturndatatothehost(0xFF),returndatatoavariable(0x01through0x78),returndatatoanindirectvariable(0x81through0xF8),anddonotreturndata(0).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroora
UsingThisVI
TheInvertVariableVIperformsabitwiselogicalNOTonthevalueintheselectedvariableandreturnstheresulttothedestinationspecifiedbytheRetVect.
~(V1)=Result
where:V1isthevalueatVar1.ResultisstoredinthelocationpointedtobyRetVect.
Theresultcanbereturnedtoanewvariableortotheinputvariable,returnedtothehostcomputer,orthrownaway.Inallcasestheconditioncodesaresetaccordingtotheresultingvalue.Theresultingvalueiscomparedtozero,andtheappropriateconditioncodeisset:GREATERTHAN,LESSTHAN,orEQUALtozero.TheEQUALconditioncodeissettoTrueiftheresultequalszero(allbitslow)andFalseifanybitisset.TheGREATERTHANandLESSTHANcodesarealsosetbutcanbeconfusingafterlogicalbitwiseoperations.
Example
IfthevalueinVar1is0x00005A5A,theresultofthebitwiseNOTis0xFFFFA5A5.TheEQUALconditioncodeissettoFalse.
LoadConstanttoVariableLoadsaconstantvalueintoavariable.
Details
DeviceCompatibility
Value(0)isthevaluetoloadintothevariable.BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.Varisthevariabletoload.Validinputsarevariables(0x01through0x78)andindirectvariables(0x81through0xF8).errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.UsetheerrorhandlerVIstolookupthemeaningofthiscodeanddisplaythecorrespondingerrormessage.sourceisastringthatindicatestheoriginoftheerror,ifany.
UsingThisVI
TheLoadConstanttoVariableVIloadsaconstantvalueintotheselectedvariable.
Theconditioncodesaresetaccordingtotheloadedvalue,GREATERTHAN,LESSTHAN,orEQUALtozero.
LogicalShiftVariablePerformsalogicalshiftonthevalueinavariableandreturnstheresult.
Details
DeviceCompatibility
LogicalShiftisthenumberofbitstoshift.ApositiveLogicalShiftvalueshiftsVar1totheleftandanegativevalueshiftsVar1totheright.Theshiftrangeis-31through+31bits.Var1isthevariableholdingthevaluetoshift.Validinputsarevariables(0x01through0x78)andindirectvariables(0x81through0xF8).BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.RetVectindicatesthedestinationforthereturndatageneratedbythisVI.Availablereturnvectorsincludereturndatatothehost(0xFF),returndatatoavariable(0x01through0x78),returndatatoanindirectvariable(0x81through0xF8),anddonotreturndata(0).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowing
UsingThisVI
TheLogicalShiftVariableVIperformsalogicalshiftonthevalueintheselectedvariableandreturnstheresulttothedestinationspecifiedbytheRetVect.
ForpositiveLogicalShiftvalues:
V1«LogicalShift=Result
FornegativeLogicalShiftvalues:
V1»LogicalShift=Result
where:V1isthevalueatVar1.ResultisstoredinthelocationpointedtobyRetVect.
Theresultcanbereturnedtoanewvariableortotheinputvariable,returnedtothehostcomputerorthrownaway.Inallcasestheconditioncodesaresetaccordingtotheresultingvalue,GREATERTHAN,LESSTHAN,orEQUALtozero.
ThisVIactuallyperformsanarithmeticratherthanlogicalshiftifthevariableisasigned32-bitvalue(i32).Negativevaluesaresign-extendedwhenshiftedtotheright.YoucanusethisVItoperformdivisionorscalingofsignedorunsignednumbers.InthiscasetheVIeffectivelyperformsthefollowing:
V1×2(LogicalShift)=Result
Example1
IfthevalueinVar1is0x0000F002andLogicalShift=–1,thisVIreturns0x00007801.
Example2
MultiplyVariablesMultipliesthevaluesinthetwovariablesandreturnstheresult.
Details
DeviceCompatibility
Var2isthevariableholdingthesecondoperand.Validinputsarevariables(0x01through0x78)andindirectvariables(0x81through0xF8).Var1isthevariableholdingthefirstoperand.Validinputsarevariables(0x01through0x78)andindirectvariables(0x81through0xF8).BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.RetVectindicatesthedestinationforthereturndatageneratedbythisVI.Availablereturnvectorsincludereturndatatothehost(0xFF),returndatatoavariable(0x01through0x78),returndatatoanindirectvariable(0x81through0xF8),anddonotreturndata(0).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,or
UsingThisVI
TheMultiplyVariablesVImultipliesthevaluesinthetwovariablesandreturnstheresulttothedestinationspecifiedbytheRetVect.
V1×V2=Result
where:V1isthevalueatVar1.V2isthevalueatVar2.ResultisstoredinthelocationpointedtobyRetVect.
Theresultcanbereturnedtoanewvariableoroneofthetwoinputvariables,returnedtothehostcomputerorthrownaway.Inallcasestheconditioncodesaresetaccordingtotheresultingvalue.Theresultingvalueiscomparedtozero,andtheappropriateconditioncodeisset:GREATERTHAN,LESSTHAN,orEQUALtozero.
NoteBecarefulwhenmultiplyingtwolargevalues.Theresultcanoverflowandwraparound.Anerrorisnotgeneratedwhenanoverflowoccurs.
ORVariablesPerformsabitwiseORofthevaluesinthetwovariablesandreturnstheresult.
Details
DeviceCompatibility
Var2isthevariableholdingthesecondoperand.Validinputsarevariables(0x01through0x78)andindirectvariables(0x81through0xF8).Var1isthevariableholdingthefirstoperand.Validinputsarevariables(0x01through0x78)andindirectvariables(0x81through0xF8).BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.RetVectindicatesthedestinationforthereturndatageneratedbythisVI.Availablereturnvectorsincludereturndatatothehost(0xFF),returndatatoavariable(0x01through0x78),returndatatoanindirectvariable(0x81through0xF8),anddonotreturndata(0).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.If
UsingThisVI
TheORVariablesVIperformsabitwiselogicalORofthevaluesinthetwovariablesandreturnstheresulttothedestinationspecifiedbytheRetVect.
V1ORV2=Result
where:V1isthevalueatVar1.V2isthevalueatVar2.ResultisstoredinthelocationpointedtobyRetVect.
Theresultcanbereturnedtoanewvariableoroneofthetwoinputvariables,returnedtothehostcomputerorthrownaway.Theresultingvalueiscomparedtozero,andtheappropriateconditioncodeisset:GREATERTHAN,LESSTHAN,orEQUALtozero.TheEQUALconditioncodeissetTrueiftheresultequalszero(allbitslow)andFalseifanybitisset.TheGREATERTHANandLESSTHANcodesarealsosetbutcanbeconfusingafterlogicalbitwiseoperations.
Example
IfthevaluesinVar1andVar2are0x5A5A1234and0x82820000,respectively,theresultofthebitwiseORis0xDADA1234whichisNOTEQUALtozero.
ReadVariableReadsthevalueofavariableandreturnstheresult.
Details
DeviceCompatibility
Varisthevariabletoread.Validinputsarevariables(0x01through0x78)andindirectvariables(0x81through0xF8).BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.RetVectindicatesthedestinationforthereturndatageneratedbythisVI.Availablereturnvectorsincludereturndatatothehost(0xFF),returndatatoavariable(0x01through0x78),returndatatoanindirectvariable(0x81through0xF8),anddonotreturndata(0).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.UsetheerrorhandlerVIstolookupthemeaningof
UsingThisVI
TheReadVariableVIreadsthevalueoftheselectedvariableandreturnsittothedestinationspecifiedbytheRetVect.
IfthevalueofRetnVectissettoReturntoHost(0xFF),thisVIalsoreadsthevaluefromthereturndatabufferandpassesitbackasoutput.
Theconditioncodesaresetaccordingtothevalueread:GREATERTHAN,LESSTHANorEQUALtozero.
SubtractVariablesSubtractsthevalueofsecondvariablefromthevalueofthefirstvariableandreturnstheresult.
Details
DeviceCompatibility
Var2isthevariableholdingthesecondoperand.Validinputsarevariables(0x01through0x78)andindirectvariables(0x81through0xF8).Var1isthevariableholdingthefirstoperand.Validinputsarevariables(0x01through0x78)andindirectvariables(0x81through0xF8).BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.RetVectindicatesthedestinationforthereturndatageneratedbythisVI.Availablereturnvectorsincludereturndatatothehost(0xFF),returndatatoavariable(0x01through0x78),returndatatoanindirectvariable(0x81through0xF8),anddonotreturndata(0).RefertoInputandReturnVectorsformoredetailedinformation.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
UsingThisVI
TheSubtractVariablesVIsubtractsthevalueofsecondvariablefromthevalueofthefirstvariableandreturnstheresulttothedestinationspecifiedbytheRetVect.
V1–V2=Result
where:V1isthevalueatVar1.V2isthevalueatVar2.ResultisstoredinthelocationpointedtobyRetVect.
Theresultcanbereturnedtoanewvariableoroneofthetwoinputvariables,returnedtothehostcomputerorthrownaway.Inallcasestheconditioncodesaresetaccordingtotheresultingvalue.Thisvalueiscomparedwith0,andtheappropriateconditioncodeisset:GREATERTHAN,LESSTHAN,orEQUALtozero.
ThisVIisoftenusedtocomparetwovaluespriortoexecutingaconditionaljumpwiththeJumptoLabelonConditionVI.Inthiscase,theresultistypicallythrownawaybysettingRetVect=0.
ObjectManagementVIsYoucanuseObjectManagementVIstoorganize,annotate,andsaveprogramorbufferobjectstoflashROM.TheseadvancedVIsareprimarilyusedforapplicationsthatrequirenon-volatileprogramstorage.YoucanrunprogramsoutofRAMandcreateandusebuffersinRAMwithoutusinganyoftheseVIs.
ClicktheiconsforVIdescriptions.
ObjectMemoryManagement
LoadMemoryObjectDescription
ReadMemoryObjectDescription
ReadObjectRegistry
LoadMemoryObjectDescriptionLoadsanASCIItextdescriptionforaprogramorbufferobject.
Details
DeviceCompatibility
DescriptionisanASCIIcharacterarrayofupto32charactersthatdescribestheobject.BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.Object(1)isaprogramorbufferstoredinonboardRAM.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.UsetheerrorhandlerVIstolookupthemeaningof
UsingThisVI
TheLoadMemoryObjectDescriptionVIloadsatextdescriptionforaprogramorbufferobject.TheASCIItextdescriptionisusefulasaquickreminderofthecontentsorpurposeofanobjectstoredinmemory.
NoteThisVImustbeexecutedwhiletheobjectisstillinRAM.AftertheobjectissavedtoROM,itsdescriptioncannotbechanged.
Thedescriptionislimitedto32characters;extracharactersareignored.YoucanretrievethestoreddescriptionwiththeReadMemoryObjectDescriptionVI.
ObjectMemoryManagementSaves,deletes,orfreesprogramsorbuffersinRAMandROM.
Details
DeviceCompatibility
Operationistheoperationtoperformonthememoryobject,asfollows:
Value Definition0 Save1 Delete2 FreeBoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.Object(1)isaprogramorbufferstoredinonboardRAM.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.
UsingThisVI
TheObjectMemoryManagementVIisusedtosavetoROM,deletefromROM,orfreefromRAM,aprogramorbufferobject.Objectssavedtonon-volatileFlashROMareavailableforuseatanyfuturetime,evenafterpowercycles.
TosaveanobjecttoROM,callthisVIwithOperation=Save.TheobjectiscopiedtoROMandexistsinbothRAMandROMuntilthenextpowercycle,whentheRAMimageiserased.
ToremoveanobjectfromROM,callthisVIwithOperation=Delete.TheobjectisdeletedfrombothROMandRAM(ifitstillexistsinRAM).
AfteryouhavesavedanobjecttoROM,youcanfreeupitsspaceinRAMbycallingthisVIwithOperation=Free.ThishasnoeffectonthecopyinROMbutdeletestheimageinRAM,makingmorememoryavailableforstoringadditionalprogramsorotherobjects.
NoteYoucannotsaveordeleteanobjectwhileanyprogramisrunningoranybufferisinuse.Also,youcannotfreeaprogramorbufferwhileitisrunning.Inaddition,youcannotsaveordeleteanobjectwhenanymotorismoving.AttemptingtoexecutethisVIinthesecasesgeneratesanerror.
Youcandeleteabufferthatisactive,suchasahigh-speedcapturebufferthatiswaitingforatrigger,butNI-Motionreturnsanerrorinthiscase.TipSavingordeletinganobjecttakes2to4seconds.
The7340controllerhas64KBofRAMplus128KBofROM(dividedintotwo64KBsectors)forprogramandbufferstorage.YoucanrunprogramsfromeitherRAMorROM,butyoucannotsplitprogramsbetweenthetwo,andyoucannotsplitprogramsbetweenthetwo64KBROMsectors.Withanaveragecommandsizeof10bytes,asingleprogramcanbeaslargeas6,400commands.Asanotherexample,the7340controllercansimultaneouslyexecute10programs,fivefromRAMandfivefromROM,witheachprogramupto1,280commandslong.
ReadMemoryObjectDescriptionReadstheASCIItextdescriptionforaprogramorbufferobject.
Details
DeviceCompatibility
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.Object(1)isaprogramorbufferstoredinonboardRAM.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.UsetheerrorhandlerVIstolookupthemeaningofthiscodeanddisplaythecorrespondingerrormessage.sourceisastringthatindicatestheoriginoftheerror,ifany.
UsingThisVI
TheReadMemoryObjectDescriptionVIreturnstheASCIItextdescriptionforaprogramorbufferobject.TheASCIItextdescription,previouslyloadedwiththeLoadMemoryObjectDescriptionVI,isusefulasaquickreminderofthecontentsorpurposeofanobjectstoredinmemory.
ReadObjectRegistryReadsadatarecordforamemoryobjectfromtheObjectRegistry.
Details
DeviceCompatibility
Indexistheregistryrecordnumber.Therangeforindexis0to31.BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.UsetheerrorhandlerVIstolookupthemeaningofthiscodeanddisplaythecorrespondingerrormessage.sourceisastringthatindicatestheoriginoftheerror,ifany.Typically,sourceisthenameoftheVIinwhichtheerroroccurred.
RegistryRecordisthedatarecordcontainingobjectinformation.Object
UsingThisVI
TheReadObjectRegistryVIreturnsaregistryrecordforanobjectfromtheObjectRegistry.TheObjectRegistrycontainsinformationaboutallobjectsstoredinmemory.Youcanstoreupto32objectsinRAMand/orROM.Eachtimeanobjectisstored,anewrecordiscreatedtokeeptrackofit.
NoteIfanobjectexistsbothinRAMandROM,thisVIreportstheobjectasexistinginRAM.ToseetheobjectinROM,youmustfirstfreetheobjectfromRAM.
On7330and7340motioncontrollers,objectsareinRAMifPStart0x100000,andinROMifPStart<0x100000.Onthe7350controller,objectsareinRAMifPStart 0x200000,andinROMifPStart<0x200000.
RegistryrecordsarereferencedbyindexandeachcalltothisVIreturnsinformationaboutthereferencedobject.Theindexisnotthesameastheobjectnumber.Youcanuseupto255uniqueobjectnumbers(0x01through0xFF)butonly32objectscanbestoredinmemoryatonetime.
AdvancedVIsYoucanusetheadvancedVIstocontrolthecommunicationsbetweenthehostcomputerandNImotioncontroller.TheseVIsallowyoutocheckthestatusofcommunications,cleartheRDB,andmanagethelow-levelcommunicationstothecontroller.YoutypicallydonothavetouseanyoftheseVIsbecausethedefaultconfigurationiscorrectforalmostallapplications.TheseVIsareavailabletohandlespecialapplications.
TheadvancedVIsincludespecializedReadandWriteVIsforquicklyviewingaxisorcoordinatedataorstatusinformation,configuringI/Olines,andsoon.
TheadvancedVIsalsoincludeadvancedmethodsandtwoutilityVIsthatareregularlyusedbutaredifferentfromtherestoftheNI-MotionAPIinthattheyarenottypicallyincludedinapplicationcode:ClearPowerUpStatusandSaveDefaultParameters.
ClicktheiconsforVIdescriptions.
ReadCommunicationStatus ReadBoardTemperatureFlushReturnDataBuffer ReadReturnDataBufferClearPowerUpStatus EnableAutoStartResetDefaultParameters EnableShutdownSaveDefaultParameters
Subpalettes
AdvancedReadVIs
AdvancedWriteVIs
AdvancedMethods
ClearPowerUpStatusClearsthePower-Upstatusbitandbootsupthecontroller,makingitreadytoacceptcommands.
DetailsRemarks
DeviceCompatibility
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.UsetheerrorhandlerVIstolookupthemeaningofthiscodeanddisplaythecorrespondingerrormessage.sourceisastringthatindicatestheoriginoftheerror,ifany.Typically,sourceisthenameoftheVIinwhichtheerroroccurred.
BdIDOutisprovidedforflowcontrol.YoucanstringtogetherNI-
UsingThisVI
Wheneverthemotioncontrollerisresetbyapowercycle,watchdogtimeout,orothermeans,thecontrollerissuspendedinapower-upstateandaPower-UpstatusbitintheCommunicationsStatusRegister(CSR)isset.TheClearPowerUpStatusVIisusedtoclearthisbitandreadythecontrollerformotioncontrolcommunications.
YoucannotexecutemostoftheothermotioncontrolVIsuntilthePower-UpstatusbitisclearedbythisVI.Thislockoutensuresthatyouareawareoftheoccurrenceofanunexpectedreset,asinthecaseofawatchdogtimeout.
YoucanincludethisVIonetimeatthebeginningofaninitializationroutine,buttoavoidthepossibilityofrestartinganapplicationunexpectedlyafterapowercycleorwatchdogtimeout,youmustnotincludeitinotherroutines.TheInitializeControllerVIautomaticallycallsthisVI.
NoteIfyouarerunningaNI-MotionstartupapplicationonETS(PharLap)systems,thefirstVIinyourapplicationmustbeeithertheClearPowerUpStatusorInitializeControllerVI.CallinganyotherVIfirstmayresultinerror–70012(NIMC_badBoardIDError)becausethedrivermaynothaveloadedbeforeaNI-MotionVIiscalled.
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NI73xxControllerConsiderations
ThefollowingincludesconsiderationsyoumustmakewhenyouareusingthisVIwitha73xxmotioncontroller:
WhenthemotioncontrollerisinthePower-Upstate,theMCSregistercontainsapower-upcodethatdescribeswhythecontrollerisinthePower-Upstate.Toaccessthiscode,executetheReadMoveCompleteStatusVI.Thefollowingtabledescribesthepower-upcodes.
Code ResetType Cause0x80 Busreset NormalPCpowercycle
0x40 Power-Upreset NormalPCpowercycle
0x20 Watchdogtimeout Fatalinternalerror
0x08 Shutdown Shutdown(E-Stop)inputactive;refertotheEnableShutdownVI
0x02 Softwarereset Firmwaredownload
NISoftMotionControllerConsiderations
ThefollowingincludesconsiderationsyoumustmakewhenyouareusingthisVIwiththeNISoftMotionController:
Thepower-upcodesdonotapplytotheNISoftMotionController.
EnableAutoStartAllowsyoutoautomaticallyrunaprogramwhenthecontrollerpowersup.
Details
DeviceCompatibility
ProgramToExecute(1)istheonboardprogramthecontrollerexecutesiftheautostartfeatureisenabled.Thismustbeavalidprogramnumber(1-255),thatisstoredtoFLASHusingtheObjectMemoryManagementVI.EnableAutoStartenablesordisablestheautostartfeature.SetthistoEnable(true)toenableautostartandDisable(false)todisableautostart.BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,
UsingThisVI
TheEnableAutoStartVIconfiguresthecontrollertoautomaticallystartanonboardprogramonpowerup.Afterautostartisenabled,thecontrollerautomaticallyexecutestheonboardprogramspecifiedwhenthecontrollerispoweredon.TheonboardprogramtoexecutemustbesavedtoFLASHusingtheObjectMemoryManagementVIbeforethecontrollerispowereddown.Ifthecontrollerdoesnotfindavalidprogramthatitcanload,NIMC_autoStartFailedErrorisgenerated.IftheonboardprogramisremovedfromFLASHmemory,theautostartfunctionalityisdisabled.
NoteThisVIwritestoonboardFLASHmemoryandhenceitisnotsafetoexecutewhenmotorsareinmotion.DoingsogeneratesaNIMC_wrongModeError.
ThisVImaytakelongerthan62mstoprocess,soitisnotguaranteedtobecompatiblewithreal-timeexecution.
EnableShutdownEnablestheshutdown(E-Stop)functionalityofthecontroller.
DetailsRemarks
DeviceCompatibility
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.UsetheerrorhandlerVIstolookupthemeaningofthiscodeanddisplaythecorrespondingerrormessage.sourceisastringthatindicatestheoriginoftheerror,ifany.Typically,sourceisthenameoftheVIinwhichtheerroroccurred.
BdIDOutisprovidedforflowcontrol.YoucanstringtogetherNI-MotionVIsbywiringtheBdIDOutterminalofoneVItotheBoardIDterminalofthenextVI.
UsingThisVI
TheEnableShutdownVIenablesthecontrollertoreacttotheshutdown(E-Stop)input.Whentheshutdown(E-Stop)inputtransitionsfromlowtohigh,thecontrollergoesintoashutdownstate.Thefollowingactionstakeplaceintheshutdownstate:
Alltheaxesarekilled.Onservoaxes,thecontrolloopisdisabledandtheoutputDACsarezeroed,allowingfrictionalforcesalonetostopthemotion.Onstepperaxes,thestepperpulsegenerationisstopped.Onbothaxistypes,thereisnotrajectoryprofile.Ifenabled,theinhibitoutputisactivatedtoinhibit(disable)theservoamplifierorstepperdriver.YoucanenabletheinhibitoutputsandsettheirpolarityasactivehighoractivelowwiththeConfigureInhibitOutputsVI.Alltheaxes,encoders,andADCsaredisabled.AllthedigitalI/Oisre-initializedtodefaults.IftheuserhassaveddefaultsusingtheSaveDefaultParametersVI,thedigitalI/Oisre-initializedtotheuserdefaults.Otherwise,thedigitalI/Oisre-initializedtothefactorydefaults.Allcurrentlyexecutingonboardprogramsarestopped.Thecontrollerdoesnotacceptanycommands,exceptforthefollowingones:
GetMotionBoardInformationReadErrorMessageEnableAutoStart
Theshutdownfunctionalityisdisabledbydefaultonpowerup.Thisfunctionalityhastobeenabledeverytimethecontrollerispoweredup.Youmustenablethisfeatureonlyaftertheshutdown(E-Stop)circuitisproperlyconfiguredandconnectedtothecontroller.Aftershutdown(E-Stop)isenabled,itcanbedisabledonlybyresettingorpowercyclingthecontroller.
NoteAfterthecontrollerhasshutdown,youhavetoresetitorcycleitspowerbeforeitcanbeusedagain.NoteTheactivestateoftheshutdown(E-Stop)lineislow.Topreventthecontrollerfromshuttingdownprematurely,thelinemustbehigh(inactive)
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NISoftMotionControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwiththeNISoftMotionController:
AllreadVIsareavailablewhentheNISoftMotionControllerisinashutdownstate.AllwriteVIs,includingStartMotionandStopMotion,areunavailablewhentheNISoftMotionControllerisinashutdownstate.
FlushReturnDataBufferClearstheReturnDataBuffer(RDB)bydeletingallofthebuffereddata.
Details
DeviceCompatibility
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.UsetheerrorhandlerVIstolookupthemeaningofthiscodeanddisplaythecorrespondingerrormessage.sourceisastringthatindicatestheoriginoftheerror,ifany.Typically,sourceisthenameoftheVIinwhichtheerroroccurred.
BdIDOutisprovidedforflowcontrol.YoucanstringtogetherNI-MotionVIsbywiringtheBdIDOutterminalofoneVItotheBoardID
UsingThisVI
TheFlushReturnDataBufferVIclearstheReturnDataBufferbyrepeatedlyreadingtheRDBuntilthebufferisempty.AllreturndatapacketsintheRDBaredeletedandthisVIreturnsnothing.
YoutypicallyusetheFlushReturnDataBufferVIafteranerrorconditionwhenthedataintheReturnDataBufferisnolongervalidorrelevant.ThisVIisalsousefulforflushingtheRDBafteraprogrammingerrorhascausedthebuffertobecomeskewed.BufferskewiswhenthedatareturnedbyareadVIusingthedefaultinputvectorof0xFFdoesnotreturntheexpecteddatabutratherreturnsdatarequestedbyapreviousVI.
Refertothemotioncontrollerdocumentationformoreinformationaboutlow-levelcommunicationsprotocolsandreturndatapackets.
ReadBoardTemperatureReadsthetemperaturefromthemotioncontroller.
Details
DeviceCompatibility
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.UsetheerrorhandlerVIstolookupthemeaningofthiscodeanddisplaythecorrespondingerrormessage.sourceisastringthatindicatestheoriginoftheerror,ifany.Typically,sourceisthenameoftheVIinwhichtheerroroccurred.
Temperatureisthetemperaturereadfromthetemperaturesensoronthemotioncontrollerin°C.BdIDOutisprovidedforflowcontrol.YoucanstringtogetherNI-MotionVIsbywiringtheBoardIDOutterminalofoneVItotheBoardIDterminalofthenextVI.erroroutcontainserrorinformation.Iferrorinindicatesanerror,erroroutcontainsthesameerrorinformation.Otherwise,itdescribestheerrorstatusthatthisVIproduces.
UsingThisVI
TheReadBoardTemperatureVIreadsthetemperaturein°Cfromthetemperaturesensoronthemotioncontroller.Youcanusethecurrenttemperaturesensorreadingtodeterminewhetherthedevicerequiresrecalibration.
NoteOnly7350controllerssupporttheReadBoardTemperatureVI.
ReadCommunicationStatusReadsthecommunicationstatusregister(CSR)whichrepresentsthestateofthecontroller.
DetailsRemarks
DeviceCompatibility
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.UsetheerrorhandlerVIstolookupthemeaningofthiscodeanddisplaythecorrespondingerrormessage.sourceisastringthatindicatestheoriginoftheerror,ifany.Typically,sourceisthenameoftheVIinwhichtheerroroccurred.
CommunicationsStatusRegisteristhebitmapofcommunicationstatus
UsingThisVI
Onpowerup,thecontrollerisinapower-upresetstate.RefertoClearPowerUpStatusforinformationaboutclearingtheresetcondition.
NoteRefertoVIExecutionTimesforbenchmarktiminginformationaboutyourcontroller.
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NI73xxControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwitha73xxmotioncontroller:
ThisVIperformsadirectreadoftheCommunicationStatusRegister(CSR)onthe73xxmotioncontrollers.TheCSRisahardwareregistercontainingcommunicationhandshakinganderrorstatusbits.TheNI-Motionsoftwarepollsthisregistercontinuouslywhensendingandreceivingpacketsforhandshakinganderrorcheckingpurposes.Refertoyourmotioncontrollerdocumentationformoreinformationaboutlow-levelcommunicationprotocolsandreturndatapackets.YoualsocancallthisVIatanytimetocheckthecommunicationanderrorstatus.BecausetheCSRisalwaysup-to-dateanddirectlyaccessibleoverthecomputerbus,executingthisVIdoesnotaffecttheoperationoftheNImotioncontroller.
NISoftMotionControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwiththeNISoftMotionController:
IfyouareusingtheNISoftMotionController,thisVIreadstheNISoftMotionControllerengineservicestatus.
ReadytoReceiveindicatesiftheNISoftMotionControllerisrunning.
TheNISoftMotionControllerdoesnotsupportthefollowingCSRbits:CommandInProcessPacketErrorHardwareFailReadytoSend
ReadReturnDataBufferReadstheReturnDataBuffer.
Details
DeviceCompatibility
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.UsetheerrorhandlerVIstolookupthemeaningofthiscodeanddisplaythecorrespondingerrormessage.sourceisastringthatindicatestheoriginoftheerror,ifany.Typically,sourceisthenameoftheVIinwhichtheerroroccurred.
WordCountisthenumberof16-bitwordsinthecommandpacket.
UsingThisVI
YoucanusetheReadReturnDataBufferVItoreadtheRDB.
Refertothemotioncontrollerdocumentationformoreinformationaboutlow-levelcommunicationsprotocolsandreturndatapackets.
ResetDefaultParametersResetsthepower-updefaultstothefactory-defaultsettings.
DetailsRemarks
DeviceCompatibility
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.UsetheerrorhandlerVIstolookupthemeaningofthiscodeanddisplaythecorrespondingerrormessage.sourceisastringthatindicatestheoriginoftheerror,ifany.Typically,sourceisthenameoftheVIinwhichtheerroroccurred.
BdIDOutisprovidedforflowcontrol.YoucanstringtogetherNI-MotionVIsbywiringtheBdIDOutterminalofoneVItotheBoardIDterminalofthenextVI.
UsingThisVI
TheResetDefaultParametersVIresetsthepower-updefaultstothefactory-defaultsettingsforallimportantconfiguration,initialization,andtrajectoryparametersforuseaftersubsequentpower-upresets.WhenyouexecutethisVI,allparametersaresavedtononvolatileflashmemoryandbecomethepower-updefaults.
NoteTheeffectofthisVIisnotrealizeduntilthenexttimethecontrollerispoweredupfromapower-downstate.
YouonlyneedtousethisVIifyouhavepreviouslymodifiedthepower-updefaultsusingtheSaveDefaultParametersVIandwanttorevertbacktothefactorydefaults.
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NI73xxControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwitha73xxmotioncontroller:
ThisVImaytakelongerthan62mstoprocesson73xxcontrollers.ThisVIisnotguaranteedtoexecuteinrealtimeasitperformsmemoryallocation.
SaveDefaultParametersSavesthecurrentoperatingparametersasdefaults.
DetailsRemarks
DeviceCompatibility
BoardIDisauniquenumberassignedbyMeasurement&AutomationExplorer(MAX)usedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.UsetheerrorhandlerVIstolookupthemeaningofthiscodeanddisplaythecorrespondingerrormessage.sourceisastringthatindicatestheoriginoftheerror,ifany.Typically,sourceisthenameoftheVIinwhichtheerroroccurred.
BdIDOutisprovidedforflowcontrol.YoucanstringtogetherNI-MotionVIsbywiringtheBdIDOutterminalofoneVItotheBoardIDterminalofthenextVI.
UsingThisVI
TheSaveDefaultParametersVIsavesallimportantconfiguration,initialization,andtrajectoryparametersforuseaftersubsequentpower-upresets.WhenyouexecutethisVI,allparametersaresavedtononvolatileflashmemoryandbecomethepower-updefaults.
Ifnecessary,youcanreinstatethefactory-defaultparametersasthepower-updefaultswiththeResetDefaultParametersVI.
ThisVIdoesnotperformacompletestatesave.Forproperandsafeoperationafterpower-up,certainparametersarealwaysresettotheirfactorydefaultstobringthecontrollerbacktoaknownsafestate.Parametersnotstoredareleftoutbydesignandaretypicallyresettozeroatpower-up.
NoteIfyouwanttorememberaparameterthatisnotincludedinthislist,youcancopythatparametertoageneral-purposevariableanditissavedwiththisVI.Youcanthenresettheparametertothesavedvaluewithaprogramdesignedforthispurpose.
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NI73xxControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwitha73xxmotioncontroller:
ThisVImaytakelongerthan62mstoprocesson73xxcontrollers.ThisVIisnotguaranteedtoexecuteinrealtimeasitperformsmemoryallocation.Whenthecontrollerispoweredup,thedefaultsareautomaticallyapplied.Thereissometime,however,betweenthecontrollerpoweringupandtheapplicationofdefaults.
Thedefaultsonthestep,direction,breakpoint,andanalogoutputsignalsdonottakeeffectuntilthepowerupresetstateiscleared.UsetheClearPowerUpStatusVItoclearthepowerupresetstate.
NISoftMotionControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwiththeNISoftMotionController:
Userdefaultsarenotapplieduntilthepowerupresetstateiscleared.UsetheClearPowerUpStatusVItoclearthepowerupresetstate.Refertothedocumentationforyourdrivefortheinitialpoweronstateofthedrive.
AdvancedReadVIsYoucanusetheadvancedreadfunctionstoviewaxisorcoordinateexecutiondataandstatusinformation,I/Ostatusinformation,encoderexecutiondata,andsoon.
ClicktheiconsforVIdescriptions.
ReadExecutionStatus
ReadExecutionData
ReadEncoderData
ReadCaptureCompareData
ReadMotionI/OData
ReadDigitalI/OData
ReadExecutionDataReadsposition,velocity,andfollowingerrorinformationonanaxisorcoordinate.YoucanusethispolymorphicVItoreadexecutiondataofasingleaxisattribute,allexecutiondatainformationfromanaxis,positioninformationforallaxesinacoordinate,orvelocityorfollowingerrorinformationforacoordinate.
Usethepull-downmenutoselectaninstanceofthisVI.
Selectaninstance
Details
DeviceCompatibility
ReadAxisData
attributeistheattributeyouwanttoread.Thefollowingarevalidattributes:
position—Returnsthepositiontothedoubleelementofthedatacluster.velocity—Returnsthevelocitytothedoubleelementofthedatacluster.followingerror—Returnsthefollowingerrortothedoubleelementofthedatacluster.
boardinisauniquenumberassignedbyMeasurement&AutomationExplorerusedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.axisinistheaxistoreadwiththisVI.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.UsetheerrorhandlerVIstolookupthemeaningofthiscodeanddisplaythecorrespondingerrormessage.sourceisastringthatindicatestheoriginoftheerror,ifany.Typically,sourceisthenameoftheVIinwhichtheerroroccurred.
dataisaclusterofvariablesthatcontainsthevaluesfortheselectedattribute.Readthecorrectelementoftheclusterfortheattribute.Thevaluesoftheotherelementsintheclusterareundefined.
integeris32-bitintegerdata.doubleis64-bitfloatingpointdata.
ReadAllAxisData
boardinisauniquenumberassignedbyMeasurement&AutomationExplorerusedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.axisinistheaxistoreadwiththisVI.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.UsetheerrorhandlerVIstolookupthemeaningofthiscodeanddisplaythecorrespondingerrormessage.sourceisastringthatindicatestheoriginoftheerror,ifany.Typically,sourceisthenameoftheVIinwhichtheerroroccurred.
axisdataisthedatarecordcontainingaxisexecutiondata.positioncontainsaxispositioninformation.velocitycontainsfilteredvelocityincounts/s(forservoaxes)orsteps/s(forstepperaxes).Thesignofvelocityindicatesdirectionofmotion.followingerrorcontainstheinstantaneousdifferencebetweenthecommandedtrajectorypositionandtheactualfeedbackpositionincountsforservosystemsandstepsforsteppersystems.encoderpositioncontainsthequadraturecountvalueoftheencodermappedtotheselectedaxis.
boardoutisprovidedforflowcontrol.YoucanstringtogetherNI-MotionVIsbywiringtheboardoutterminalofoneVItotheboardinterminalofthenextVI.axisoutisprovidedforflowcontrol.YoucanstringtogetherNI-MotionVIsbywiringtheaxisoutterminalofoneVItotheaxisinterminalofthe
ReadCoordinateData
attributeistheattributeyouwanttoread.Thefollowingarevalidattributes:
velocity—Returnsthevelocitytothedoubleelementofthedatacluster.followingerror—Returnsthefollowingerrortothedoubleelementofthedatacluster.
boardinisauniquenumberassignedbyMeasurement&AutomationExplorerusedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.coordinateinisthecoordinatetoreadwiththisVI.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.UsetheerrorhandlerVIstolookupthemeaningofthiscodeanddisplaythecorrespondingerrormessage.sourceisastringthatindicatestheoriginoftheerror,ifany.Typically,sourceisthenameoftheVIinwhichtheerroroccurred.
dataisaclusterofvariablesthatcontainsthevaluesfortheselectedattribute.Readthecorrectelementoftheclusterfortheattribute.Thevaluesoftheotherelementsintheclusterareundefined.
integeris32-bitintegerdata.doubleis64-bitfloatingpointdata.BooleanisBooleandata.
boardoutisprovidedforflowcontrol.YoucanstringtogetherNI-Motion
ReadCoordinatePosition
boardinisauniquenumberassignedbyMeasurement&AutomationExplorerusedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.coordinateinisthecoordinatetoreadwiththisVI.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.UsetheerrorhandlerVIstolookupthemeaningofthiscodeanddisplaythecorrespondingerrormessage.sourceisastringthatindicatestheoriginoftheerror,ifany.Typically,sourceisthenameoftheVIinwhichtheerroroccurred.
positionsisthearraycontainingthecoordinatepositioninformation.boardoutisprovidedforflowcontrol.YoucanstringtogetherNI-MotionVIsbywiringtheboardoutterminalofoneVItotheboardinterminalofthenextVI.coordinateoutisprovidedforflowcontrol.YoucanstringtogetherNI-MotionVIsbywiringthecoordinateoutterminalofoneVItothecoordinateinterminalofthenextVI.erroroutcontainserrorinformation.Iferrorinindicatesanerror,erroroutcontainsthesameerrorinformation.Otherwise,itdescribestheerrorstatusthatthisVIproduces.
statusisTRUEifanerroroccurred,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroora
UsingThisVI
CautionIfthisVIusesreflectivememory,itshouldnotbeusedforeventchecking.Inthiscase,onlyusetheinformationreturnedbythisVIfordisplaypurposes.RefertoReflectiveMemoryVIsformoreinformation.NoteBecauseofthewaythecontrollerupdatesinformation,thevaluesreturnedarenotguaranteedtoallbesampledinthesametimeslice.
AxisDataInstances
ThesingleaxisversionsofthisVIreturnexecutiondataontheselectedaxis.
Foropen-loopstepperaxes,theVIreturnspositioninformationinnumberofstepsgenerated.Forclosed-loopstepperaxes,itconvertstheprimaryfeedbackpositionfromcountstostepsandthenreturnsthevalueinsteps.Closed-loopstepperaxesrequireyoutocorrectlyloadvaluesofstepsperrevolutionandcountsperrevolutiontofunctioncorrectly.
NoteForclosed-loopaxes,thisVIalwaysreturnsthepositionoftheprimaryfeedbackresource.RefertotheReadCoordinatePositioninstanceofthisVIforaneasywaytoreadthepositionsofallaxesinacoordinateinonecall.
Foraxisvelocity,thisVIreturnsfilteredvelocityincounts/s(forservoaxes)orsteps/s(forstepperaxes).Thesignofvelocityindicatesdirectionofmotion.
Foraxisfollowingerror,thisVIreturnstheinstantaneousdifferencebetweenthecommandedtrajectorypositionandtheactualfeedbackpositionincountsforservosystemsandstepsforsteppersystems.
Encoderpositiondataisinquadraturecountvalueoftheencodermappedtotheselectedaxis.
Duringaxissetup,youcanoperatetheclosed-loopstepperaxisinopen-loopmodeandusethisVItodirectlymeasurethecountsperrevolutionandstepsperrevolutionfortheaxis.Thesevaluesmustbeloadedbeforeforsubsequentclosed-loopoperation.RefertotheLoadCounts/StepsperRevolutionVIformoreinformation.
Youalsocanuseencoderpositiontoreturnafinerreadingofpositionincaseswheretheencoderresolutiongreatlyexceedsthestepresolutionoftheclosed-loopstepperaxis.
ReadExecutionStatusYoucanusethispolymorphicVItoreadtheexecutionstatusofaselectedaxisexecutionstatusattribute,allexecutionstatusattributesonanaxis,oraselectedcoordinateexecutionstatusattribute.
Usethepull-downmenutoselectaninstanceofthisVI.
Selectaninstance
Details
DeviceCompatibility
ReadAxisStatus
attributeistheattributeyouwanttoread.RefertotheDetailssectionformoreinformation.Thefollowingarevalidattributes:
axisactive—ReturnsthestatustotheBooleanelementofthedatacluster.movecomplete—ReturnsthestatustotheBooleanelementofthedatacluster.profilecomplete—ReturnsthestatustotheBooleanelementofthedatacluster.blendcomplete—ReturnsthestatustotheBooleanelementofthedatacluster.followingerrorexceeded—ReturnsthestatustotheBooleanelementofthedatacluster.velocitythresholdexceeded—ReturnsthestatustotheBooleanelementofthedatacluster.axismoving—ReturnsthestatustotheBooleanelementofthedatacluster.directionforward—ReturnsthestatustotheBooleanelementofthedatacluster.
boardinisauniquenumberassignedbyMeasurement&AutomationExplorerusedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.axisinistheaxistoreadwiththisVI.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroora
ReadAllAxisStatus
boardinisauniquenumberassignedbyMeasurement&AutomationExplorerusedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.axisinistheaxistoreadwiththisVI.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.UsetheerrorhandlerVIstolookupthemeaningofthiscodeanddisplaythecorrespondingerrormessage.sourceisastringthatindicatestheoriginoftheerror,ifany.Typically,sourceisthenameoftheVIinwhichtheerroroccurred.
axisstatusisthedatarecordcontainingaxisstatusinformation.RefertotheDetailssectionformoreinformation.boardoutisprovidedforflowcontrol.YoucanstringtogetherNI-MotionVIsbywiringtheboardoutterminalofoneVItotheboardinterminalofthenextVI.axisoutisprovidedforflowcontrol.YoucanstringtogetherNI-MotionVIsbywiringtheaxisoutterminalofoneVItotheaxisinterminalofthenextVI.erroroutcontainserrorinformation.Iferrorinindicatesanerror,erroroutcontainsthesameerrorinformation.Otherwise,itdescribestheerrorstatusthatthisVIproduces.
statusisTRUEifanerroroccurred,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,
ReadCoordinateStatus
attributeistheattributeyouwanttoread.RefertotheDetailssectionformoreinformation.Thefollowingarevalidattributes:
movecomplete—ReturnsthestatustotheBooleanelementofthedatacluster.profilecomplete—ReturnsthestatustotheBooleanelementofthedatacluster.blendcomplete—ReturnsthestatustotheBooleanelementofthedatacluster.followingerrorexceeded—ReturnsthestatustotheBooleanelementofthedatacluster.
boardinisauniquenumberassignedbyMeasurement&AutomationExplorerusedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.coordinateinisthecoordinatetoreadwiththisVI.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.UsetheerrorhandlerVIstolookupthemeaningofthiscodeanddisplaythecorrespondingerrormessage.sourceisastringthatindicatestheoriginoftheerror,ifany.Typically,sourceisthenameoftheVIinwhichtheerroroccurred.
dataisaclusterofvariablesthatcontainsthevaluesfortheselectedattribute.Readthecorrectelementoftheclusterfortheattribute.Thevaluesoftheotherelementsintheclusterareundefined.
integeris32-bitintegerdata.
UsingThisVI
UsethisVItoreadtheexecutionstatusofanaxisorcoordinate.
CautionIfthisVIusesreflectivememory,itshouldnotbeusedforeventchecking.Inthiscase,onlyusetheinformationreturnedbythisVIfordisplaypurposes.RefertoReflectiveMemoryVIsformoreinformation.NoteRefertoVIExecutionTimesforbenchmarktiminginformationaboutyourcontroller.
TheVIwillreturnTrueorFalsebasedonthefollowingcriteria:
Element ExecutionStatusaxisactive
True=motorisonFalse=motorisoff
movecomplete
True=movecompleteFalse=movenotcomplete
profilecomplete
True=profileiscompleteFalse=profilegenerationinprocess
blendcomplete
True=blendcompleteFalse=blendpending
followingerrorexceeded
True=axisorcoordinateaxisexceededtheprogrammedfollowingerrorlimitFalse=axisorcoordinateaxisfollowingerrorisbelowtheprogrammedfollowingerrorlimit
NoteIfyouarerunningacontouredmoveorslaveaxismovewithastepperaxis,itispossiblethatthecontourvelocityortheslaveaxisgearedvelocityexceedsthemaximumsteprateofthecontroller.Inthiscase,thecontrollerkillstheaxisandsetsthefollowingerrorstatustotrue.RefertotheSpecificationssectionofyourcontrollerusermanualforthemaximumsteprateofyourcontroller.
velocitythresholdexceeded
True=axisvelocityisabovetheprogrammedvelocitythresholdFalse=axisvelocityisbelowtheprogrammedvelocitythreshold
axismoving
True=axisismovingFalse=axisisstopped
directionforward
True=axismovingforwardFalse=axismovinginreverse
index True=encoderindexpositioncaptureoccurred
ReadCaptureCompareDataReadspositioncompareorpositioncapturedatafromtheselectedaxis.
Details
DeviceCompatibility
attributeistheattributeyouwanttoread.Thefollowingarevalidattributes:
capturedposition—Returnsthepositiontothedoubleelementofthedatacluster.positioncaptureoccurred—ReturnsthestatustotheBooleanelementofthedatacluster.True(On)indicatesthatthepositioncaptureoccurredandFalse(Off)indicatesthatthepositioncapturehasnotoccurred.positioncompareoccurred—ReturnsthestatustotheBooleanelementofthedatacluster.True(On)indicatesthatthepositioncompareoccurredandFalse(Off)indicatesthatthepositioncomparehasnotoccurred.
boardinisauniquenumberassignedbyMeasurement&AutomationExplorerusedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.axisinistheaxistoreadwiththisVI.indexinistheencoderindexvalue.Validvalueis1fortheprimaryencoder.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowing
UsingThisVI
UsethisVItoreadpositioncompareorpositioncapturedatafromtheselectedaxis.
CautionIfthisVIusesreflectivememory,itshouldnotbeusedforeventchecking.Inthiscase,onlyusetheinformationreturnedbythisVIfordisplaypurposes.RefertoReflectiveMemoryVIsformoreinformation.NoteRefertoVIExecutionTimesforbenchmarktiminginformationaboutyourcontroller.
ReadDigitalI/ODataReadstheattributeonasingledigitalI/Oline.
DetailsRemarks
DeviceCompatibility
attributeistheattributeyouwanttoread.Thefollowingarevalidattributes:
outputactivestate—ReturnstheactivestateofthespecifiedoutputlinetotheBooleanelementofthedatacluster.TRUEindicatesactivelow/activeopen.FALSEindicatesactivehigh/activeclosed.inputactivestate—ReturnstheactivestateofthespecifiedinputlinetotheBooleanelementofthedatacluster.TRUEindicatesactivelow/activeopen.FALSEindicatesactivehigh/activeclosed.outputactive—ReturnsthecurrentoutputstateofthespecifiedlinetotheBooleanelementofthedatacluster.TRUEindicatestheoutputlineisactive.FALSEindicatestheoutputlineisinactive.
NoteReadingthisattributeonalineconfiguredforinputreturnserror-70102(NIMC_wrongIODirectionError).
inputactive—ReturnstheinputstateofthespecifiedlinetotheBooleanelementofthedatacluster.TRUEindicatestheinputlineisactive.FALSEindicatestheinputlineisinactive.
NoteReadingthisattributeonalineconfiguredforoutputreturnserror-70102(NIMC_wrongIODirectionError).
configureasinput—Returnsthedirectionofthespecifiedlinetothe
UsingThisVI
UsethisVItoreadtheattributeonasingledigitalI/Oline.ThedigitalI/Olinesaredividedamongtheaxes.
CautionIfthisVIusesreflectivememory,itshouldnotbeusedforeventchecking.Inthiscase,onlyusetheinformationreturnedbythisVIfordisplaypurposes.RefertoReflectiveMemoryVIsformoreinformation.
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NI73xxControllerConsiderations
ThefollowingincludesconsiderationsyoumustmakewhenyouareusingthisVIwitha73xxcontroller:
ThePCI-7390doesnotsupporttheconfigureasinputattribute.ThePCI-7390hasdedicateddirectionI/Olines.Onthesecontrollers,thepinyouread(inputoroutput)isdeterminedbythevaluespecifiedinlineinandattribute.
Forexample,toreadtheinputactivestateattributeofGeneral-PurposeInputBit1onaxis2,calltheReadDigitalI/ODataVIwiththefollowingparameters:
axisin=2linein=1attribute=inputactivestate
ToreadtheoutputactivestateofGeneral-PurposeOutputBit1onaxis2,calltheReadDigitalI/ODataVIwiththefollowingparameters:
axisin=2linein=1attribute=outputactivestate
7330,7340,and7350controllershaveconfigurabledirectionI/Olines.Onthesecontrollers,thelinenumberistranslatedtoportandlinenumber.Forexample,acalltoReadDigitalI/ODataonafouraxiscontrollerwitheightdigitalI/Oportsand
axisin=2
ReadEncoderDataReadspositionstatusordatafromtheselectedencoder.
Details
DeviceCompatibility
attributeistheattributeyouwanttoread.Thefollowingarevalidattributes:
position—Returnsthequadraturecountvalueoftheencodermappedtotheselectedaxistothedoubleelementofthedatacluster.indexposition—ReturnsthecapturedindexpositionafteraFindIndexsearchtothedoubleelementofthedatacluster.indexcaptureoccurred—ReturnsthestatustotheBooleanelementofthedatacluster.True(On)indicatesthattheencoderindexpositioncaptureoccurred.False(Off)indicatesthattheencoderindexpositionwasnotcaptured.
boardinisauniquenumberassignedbyMeasurement&AutomationExplorerusedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.axisinistheaxistoreadwiththisVI.indexinistheencoderindexvalue.Validvalueis1fortheprimaryencoder.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.If
UsingThisVI
UsethisVItoreadstatusordatafromtheselectedencoder.
CautionIfthisVIusesreflectivememory,itshouldnotbeusedforeventchecking.Inthiscase,onlyusetheinformationreturnedbythisVIfordisplaypurposes.RefertoReflectiveMemoryVIsformoreinformation.NoteRefertoVIExecutionTimesforbenchmarktiminginformationaboutyourcontroller.
ReadMotionI/ODataReadsstatusanddatafromthemotioninputsandoutputs.
DetailsRemarks
DeviceCompatibility
attributeistheattributeyouwanttoread.Thefollowingarevalidattributes:
forwardlimitactive—ReturnsthestatustotheBooleanelementofthedatacluster.TRUEindicatesthattheinputisactiveandFALSEindicatesthattheinputisinactive.reverselimitactive—ReturnsthestatustotheBooleanelementofthedatacluster.TRUEindicatesthattheinputisactiveandFALSEindicatesthattheinputisinactive.forwardsoftwarelimitactive—ReturnsthestatustotheBooleanelementofthedatacluster.TRUEindicatesthattheinputisactiveandFALSEindicatesthattheinputisinactive.reversesoftwarelimitactive—ReturnsthestatustotheBooleanelementofthedatacluster.TRUEindicatesthattheinputisactiveandFALSEindicatesthattheinputisinactive.homeinputactive—ReturnsthestatustotheBooleanelementofthedatacluster.TRUEindicatesthattheinputisactiveandFALSEindicatesthattheinputisinactive.inhibit-inactive—ReturnsthestatustotheBooleanelementofthedatacluster.TRUEindicatesthattheinputisactiveandFALSEindicatesthattheinputisinactive.
UsingThisVI
UsethisVItoreadthestatusanddatafromthemotioninputsandoutputsonthemotioncontroller.Youcanreadthestatusofthesemotioninputsandoutputsatanytime,regardlessofwhethertheyareenabled.ThelimitandhomeinputstatusduringaFindReferencemoveisundefined.RefertoWriteMotionI/ODataformoreinformation.
CautionIfthisVIusesreflectivememory,itshouldnotbeusedforeventchecking.Inthiscase,onlyusetheinformationreturnedbythisVIfordisplaypurposes.RefertoReflectiveMemoryVIsformoreinformation.NoteTheactivestateofthesesignalsdeterminesifanOnstateisactivehigh/activeclosedoractivelow/activeopen.RefertoWriteMotionI/ODataformoreinformationaboutactivestateandgeneralinformationaboutthesignals.NoteRefertoVIExecutionTimesforbenchmarktiminginformationaboutyourcontroller.
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NI73xxControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwitha73xxmotioncontroller:
Theminimumpulsewidthfortheinhibit-ininputtobedetectedisapproximately1ms.OntheNIPCI-7390controller,theinhibit-inactiveattributedoesnotreturnavalidvalueunlesstheinhibit-insignalisenabled.OntheNIPCI-7390controller,thein-positionactiveattributedoesnotreturnavalidvalueunlessthein-positionsignalisenabled.
NISoftMotionControllerConsiderations
ThefollowingincludesconsiderationsyoumustmakewhenyouareusingthisVIwiththeNISoftMotionController:
TheNISoftMotionControllerdoesnotsupportthein-positionactive,drivereadyactive,orinhibit-outactiveattributes.
AdvancedWriteVIsYoucanusetheadvancedwriteVIsforspecializedI/OoperationsinvolvingthedigitalI/Oonacontroller,foradvancedmotionI/Ooperations,ortoconfigurethetrajectorydataforamove.
ClicktheiconsforVIdescriptions.
WriteTrajectoryData
WriteCaptureCompareData
WriteMotionI/OData
WriteDigitalI/OData
WriteCaptureCompareDataLoadspositioncompareorpositioncapturedatafortheselectedaxis.
Details
DeviceCompatibility
attributeistheattributetoload.Thefollowingisthevalidattribute:
positioncomparepulsewidth—Setsthepulsewidthofthepositioncomparesignal.
boardinisauniquenumberassignedbyMeasurement&AutomationExplorerusedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.axisinistheaxistoconfigurewiththisVI.indexinistheencodertoconfigure.Validvalueis1fortheprimaryencoder.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.UsetheerrorhandlerVIstolookupthemeaningofthiscodeanddisplaythecorrespondingerrormessage.
UsingThisVI
UsethisVItoloadconfigurationparametersforpositioncaptureandcompareonthemotioncontroller.Thisfunctionallowsyoutosetallattributesonaperaxisbasis.
Usethepositioncomparepulsewidthattributetoconfigurethepulsewidthforpositioncompareoutputsthattriggerdeviceswithspecificminimumactivepulserequirements.
NoteAbreakpointacrossRTSIalwaysgeneratesanactivehighpulseof200nsduration.CautionThepositioncompare(breakpoint)frequencydependsonthevelocityanddistancebetweenpositioncompareoutputsandislimitedbythepulsewidth.Thepositioncompareoutputfrequencymustmeettherequirementsspecifiedbelowforcorrectoperation.
Thepositioncompareoutputpulsemustnotoverlapwiththenextpositioncompareevent.Ifthepositioncompareoutputpulseoverlapswiththenextpositioncompareevent,positioncomparegenerationisstoppedandthepositioncompareoutputisdisabled.Torecoverfromthissituationchangethepulsewidth,velocity,ordistancebetweenpositioncompareoutputs.Inaddition,thepositioncompareoutputfrequencycannotbegreaterthanthemaximumvalueallowedforthespecifiedpositioncomparetype.Therefore,thepositioncompareoutputfrequency,inhertz,atthespecifiedpulsewidth,inseconds,mustconformtothefollowingtwoconditions:
AND
PositionCompare
(Breakpoint)OutputType
MaximumFrequency
Single 150HzBuffered,PIDrateof62.5µsto250µs
2kHz
Buffered,PIDrategreaterthan250µs
1kHz
Periodic 4MHz
UsingThisVI
UsethisVItoloadconfigurationparametersforpositioncaptureandcompareonthemotioncontroller.Thisfunctionallowsyoutosetallattributesonaperaxisbasis.
Usethepositioncomparepulsewidthattributetoconfigurethepulsewidthforpositioncompareoutputsthattriggerdeviceswithspecificminimumactivepulserequirements.
NoteAbreakpointacrossRTSIalwaysgeneratesanactivehighpulseof200nsduration.CautionThepositioncompare(breakpoint)frequencydependsonthevelocityanddistancebetweenpositioncompareoutputsandislimitedbythepulsewidth.Thepositioncompareoutputfrequencymustmeettherequirementsspecifiedbelowforcorrectoperation.
Thepositioncompareoutputpulsemustnotoverlapwiththenextpositioncompareevent.Ifthepositioncompareoutputpulseoverlapswiththenextpositioncompareevent,positioncomparegenerationisstoppedandthepositioncompareoutputisdisabled.Torecoverfromthissituationchangethepulsewidth,velocity,ordistancebetweenpositioncompareoutputs.Inaddition,thepositioncompareoutputfrequencycannotbegreaterthanthemaximumvalueallowedforthespecifiedpositioncomparetype.Therefore,thepositioncompareoutputfrequency,inhertz,atthespecifiedpulsewidth,inseconds,mustconformtothefollowingtwoconditions:
AND
PositionCompare
(Breakpoint)OutputType
MaximumFrequency
Single 150HzBuffered,PIDrateof62.5µsto250µs
2kHz
Buffered,PIDrategreaterthan250µs
1kHz
Periodic 4MHz
WriteDigitalI/ODataSetstheattributeonasingledigitalI/Oline.
DetailsRemarks
DeviceCompatibility
datainisaclusterofvariablesthatcontainsthevaluesfortheselectedattribute.
integeris32-bitintegerdata.doubleis64-bitfloatingpointdata.BooleanisBooleandata.
Basedontheattribute,thecorrectmemberofdatainmustbesetasfollows:
Foroutputactivestate,settheBooleanelementofthedatainclustertoTRUEtosettheactivestatetoactivelow/activeopen,andsetittoFALSEtosettheactivestatetoactivehigh/activeclosed.Forinputactivestate,settheBooleanelementofthedatainclustertoTRUEtosettheactivestatetoactivelow/activeopen,andsetittoFALSEtosettheactivestatetoactivehigh/activeclosed.Foroutputactive,settheBooleanelementofthedatainclustertoTRUEtoconfiguretheoutputlineasactive,andsetittoFALSEtoconfiguretheoutputlineasinactive.Forconfigureasinput,settheBooleanelementofthedatain
UsingThisVI
UsethisVItosettheattributeonasingledigitalI/Oline.ThedigitalI/Olinesaredividedamongtheaxes.
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NI73xxControllerConsiderations
ThefollowingincludesconsiderationsyoumustmakewhenyouareusingthisVIwitha73xxcontroller:
ThePCI-7390doesnotsupporttheconfigureasinputattribute.ThePCI-7390hasdedicateddirectionI/Olines.Onthesecontrollers,thepinyouwriteto(inputoroutput)isdeterminedbythevaluespecifiedinlineinandattribute.
Forexample,tochangetheinputactivestateofline1onaxis2,callWriteDigitalI/ODatawiththefollowingparameters:
axisin=2linein=1attribute=inputactivestate
Theactivestateisappliedtoaxis2General-PurposeInputBit1.
Tochangetheoutputactivestateofline1onaxis2,callWriteDigitalI/ODatawiththefollowingparameters:
axisin=2linein=1attribute=outputactivestate
Theactivestateisappliedtoaxis2General-PurposeOutputBit1.
7330,7340,and7350controllershaveconfigurabledirectionI/Olines.Onthesecontrollers,thelinenumberistranslatedtoportandlinenumber.Forexample,acalltoWriteDigitalI/ODataonafouraxiscontrollerwitheightdigitalI/Oportswith
WriteMotionI/ODataLoadsconfigurationparametersforthemotioninputsandoutputs.
DetailsRemarks
DeviceCompatibility
datainisaclusterofvariablesthatcontainsthevaluesfortheselectedattribute.
integeris32-bitintegerdata.doubleis64-bitfloatingpointdata.BooleanisBooleandata.
Basedontheattribute,thecorrectmemberofdatainmustbesetasfollows:
Forforwardlimitenableandreverselimitenable,settheBooleanelementofthedatainclustertoTRUEtoenablethehardwarelimit,andFALSEtodisablethehardwarelimit.Forforwardsoftwarelimitenableandreversesoftwarelimitenable,settheBooleanelementofthedatainclustertoTRUEtoenablethesoftwarelimit,andFALSEtodisablethesoftwarelimit.Forhomeinputenable,settheBooleanelementofthedatainclustertoTRUEtoenablethehomeinput,andFALSEtodisablehomeinput.Forforwardlimitactivestate,reverselimitactivestate,andhomeinputactivestate,settheBooleanelementofthedatainclusterto
UsingThisVI
UsethisVItoloadconfigurationparametersforthemotioninputsandoutputsonthemotioncontroller.ThisVIallowsyoutosetallattributesonaperaxisbasis.
Hardwarelimitinputs,homeinputs,softwarepositionlimits,inhibitinputs,in-positioninputs,drivereadyinputs,andinhibitoutputsareenhancementsontheNImotioncontrollersandarenotrequiredforbasicmotioncontrol.WiththeexceptionoftheFindReferenceVI,youcanoperateallmotioncontrolVIswithoutenablingorusingthesesignals.TheFindReferenceVIrequiresenabledlimitandhomeinputsforoperation.FindReferencedoesnotrequireenabledsoftwarelimits.
CautionNationalInstrumentsrecommendsusinglimitsforpersonalsafety,aswellastoprotectthemotionsystem.
Theactivestateforeachhardwarelimit,home,inhibitinput,in-positioninput,andinhibitoutputcanbeconfiguredaseitheractivelow/activeopenoractivehigh/activeclosed.
Whenconfiguredasactivelow,theinputoroutputisactivewhenthereisalowsignalonthepin.Conversely,activehighmeansthattheinputoroutputisactivewhenthereisahighsignalonthepin.
Configuringanactivestateofactiveopenoractivecloseddoesnotcorrespondtothelevelofthesignalontheinputoroutputpin.Instead,anactiveopenstatemeansthattheinputoroutputisactivewhencurrentisnotflowingthroughtheoptocoupledinput.Conversely,anactiveclosedstatemeansthattheinputoroutputisactivewhencurrentisflowingthroughtheoptocoupledinput.
ForwardandReverseLimits,andHomeInputs
Thehardwarelimitinputsaretypicallyconnectedtoend-of-travellimitswitchesorsensors.Anenabledlimitinputcausesahaltstopontheaxiswhentheinputbecomesactive.Activelimitinputsalsoprohibitattemptstostart
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NI73xxControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwitha73xxcontroller:
7330,7340,and7350controllersdonotsupporttheinhibit-inactivestateandin-positionactivestateattributes.UseWriteDigitalI/ODatatosettheactivestateforthesesignals.7330,7340,and7390controllersdonotsupporttheinhibit-outtotempoleattribute.7390controllersdonotsupporttheinhibit-outactivestateattribute.Tosettheactivestateona7390useWriteDigitalI/OData.Theinhibit-insignalissoftware-timedlatchedat1ms.Thissignalmustbeactiveforapproximately1mstobedetectedbythecontroller.Thefollowingtableliststhedrivesignalsandtheirimplementationonthecontroller:
SignalName SignalDirection
ControllerSupportController Drive 7330 7340 7350 7390
Inhibit-Out ServoOn Output Dedicated Dedicated Dedicated Mappable
Inhibit-In ServoAlarm Input Mappable Mappable Mappable Dedicated
DriveReady
ServoReady Input Mappable Mappable Mappable Mappable
In-Position In-Position Input Mappable Mappable Mappable Dedicated
AlarmClear
AlarmClear Output Mappable Mappable Mappable Mappable
TheactivestateofadedicatedsignalisdirectlyconfigurableusingthisVI.
WriteTrajectoryDataConfigurestrajectorygeneratorparameters.
DetailsRemarks
DeviceCompatibility
datainisaclusterofvariablesthatcontainsthevaluesfortheselectedattribute.
integeris32-bitintegerdata.doubleis64-bitfloatingpointdata.BooleanisBooleandata.
Basedontheattribute,thecorrectmemberofdatainmustbesetasfollows:
Formovecompletewhendeactivated,settheBooleanelementofthedatainclustertoTRUEtoaddmotoroffstatusasacriteriaformovecomplete,andsetittoFALSEtoremovemotoroffstatus.Formovecompletewhennotmoving,settheBooleanelementofthedatainclustertoTRUEtoaddmotorstopstatusasacriteriaformovecomplete,andsetittoFALSEtoremovemotorstopstatus.Formovecompleteafterdelay,settheBooleanelementofthedatainclustertoTRUEtoenableauser-defineddelayasacriteriaformovecomplete,andsetittoFALSEtodisableauser-defineddelay.Formovecompletetimedelay,setdoubleDataintheTnimcDatastructuretothedesiredtimedelaytowaitformovecomplete.Valid
UsingThisVI
UsethisVItoconfiguretrajectorygeneratorparametersforreportingamovecomplete.Whenamoveiscompleteonanaxis,thecorrespondingbitintheMoveCompleteStatus(MCS)registerisset.RefertoReadMoveCompleteStatusforinformationaboutreadingtheMCSregister.
Ifmovecompletewhendeactivatedistrue,anyconditionthatcausestheaxistoturnitsmotoroff(akillorfollowingerrortrip)satisfiesthisrequirementforMoveComplete.
Ifthemovecompletewhennotmovingistrue,theaxismustbelogicallystoppedforthemovetobeconsideredcomplete.
Ifmovecompleteafterdelayistrue,theaxismustwaitauser-defineddelayaftertheothercriteriaaremetbeforethemoveisconsideredcomplete.Themovecompletetimedelayattributeistypicallyusedtowaitthemechanicalsettlingtimesothatamoveisnotconsideredcompleteuntilvibrationsinthemechanicalsystemhavedampedout.ItalsocanbeusedtocompensateforPIDpull-intimeduetotheintegralterm.Thispull-inistypicallyatvelocitiesbelowtheRun/Stopthreshold.
NoteYoucanusethemovecompleteafterdelayparametertoguaranteeaminimumtimefortheFalsestate.ThestatustransitionsfromCompletetoNotCompleteatthestartofamoveandstaysintheNotCompletestateforatleastthisdelaytimeeveninthecaseofazerodistancemove.
Ifmovecompletewheninrangeistrue,theaxischecksitsfinalstoppingpositionversusitstargetpositionandonlysetstheMoveCompletestatusiftheabsolutevalueofthedifferenceislessthanmovecompleterangedistance.
Finally,ifmovecompletewheninpositionactiveistrue,thein-positioninputsignalisusedasacriteriaformovecomplete,andthemoveisonlycompleteifthein-positionsignalisactive.
Anon-zerovalueformovecompleteminimumactivetimeguaranteesthe
Remarks
ThissectionincludesinformationabouthowthebehaviorofthisVIdiffersamongthecontrollersthatsupportit.
NI73xxControllerConsiderations
ThefollowinglistincludesconsiderationsyoumustmakewhenyouareusingthisVIwitha73xxmotioncontroller:
TheNI7344doesnotsupportthemovecompletewheninpositionactiveattribute.7330,7340,and7350controllersuseConfigureMotionI/OMaptomapthein-positioninputtoageneral-purposeI/Oline.
NISoftMotionControllerConsiderations
ThefollowingincludesconsiderationsyoumustmakewhenyouareusingthisVIwiththeNISoftMotionController:
TheNISoftMotionControllerdoesnotsupportthemovecompletewheninpositionactiveattribute.
AdvancedMethodsYoucanusetheadvancedmethodsforspecializedI/Oandmoveoperations,andforspecializedcommunicationsinvolvingthecontrolleranddriveorhost.
ClicktheiconsforVIdescriptions.
AxisStraightLineMove
ConfigureMotionI/OMap
ResetMotionController
ClearFaults
AxisStraightLineMovePerformsastraightlinemoveonanaxis.
Details
DeviceCompatibility
axisstraightlinemovedataisaclustercontainingstraightlinemoveinformation.
startmodeisthestartmodeforthemove:
donotstart—Donostartthestraightlinemoveatthistime.start—Startthestraightlinemovewiththeconfiguredparameters.
positionmodeselectsthepositionmodeforthemove.RefertoDetailsformoreinformationabouttheavailablepositionmodes.
absolute—Useabsolutepositionmodeinthemove.relative—Userelativepositionmodeinthemove.velocity—Usevelocitymodeinthemove.
targetpositionisthetargetpositionforthestraightlinemoveincountsorsteps.
moveconstraintsisaclustercontainingmoveconstraintinformation:velocitysetsthevelocityforthemoveincounts/sorsteps/s.accelerationsetstheaccelerationforthemoveincounts/s2orsteps/s2.decelerationsetsthedecelerationforthemoveincounts/s2orsteps/s2.accelerationjerksetstheaccelerationjerkforthemoveincounts/s3orsteps/s3.
UsingThisVI
UsethisVItoperformastraightlinemoveonanaxis.Thepositionmodesaredescribedinthefollowingsections:
AbsolutePositionMode
Inabsolutepositionmode,targetpositionsareinterpretedwithrespecttoanorigin,reference,orzeroposition.Theoriginistypicallysetatahomeswitch,endoftravellimitswitch,orencoderindexposition.Anabsolutepositionmoveusesthespecifiedvaluesofacceleration,deceleration,andvelocitytocompleteatrajectoryprofilewithanendingpositionequaltothespecifiedabsolutetargetposition.
CautionAnysinglemoveislimitedtobetween–231and231–1countsorsteps.Anerrorisgeneratedifyouexceedthislimitbyspecifyingatargetpositiontoofarfromthecurrentposition.
Thelengthofanabsolutemovedependsuponthespecifiedpositionandthecurrentpositionwhenthemoveisstarted.Ifthetargetpositionisthesameasthecurrentposition,nomoveoccurs.
RelativePositionMode
Inrelativepositionmode,ifarelativepositionmoveisstartedwhilemotionisnotinprogress,specifiedtargetpositionsareinterpretedwithrespecttothecurrentpositionatthetimethevalueisspecified.Arelativepositionmoveusesthespecifiedvaluesofacceleration,deceleration,andvelocitytocompleteatrajectoryprofilewithanendingpositionequaltothesumofthespecifiedrelativetargetpositionandthestartingposition.
Ifarelativemoveisstartedwhilemotionisinprogress,thenewtargetpositioniscalculatedwithrespecttothetargetpositionofthemovealreadyinprogress(consideredtobethenewstartingposition),asifthatmovehadalreadycompletedsuccessfully.Motioncontinuestothenewrelativeposition,independentoftheactualpositionlocationwhenthenewmoveisstarted.
VelocityMode
Invelocitymode,theaxismovesatthespecifiedvelocityuntilyouexecuteaStopMotionVI,alimitisencountered,oranewvelocityisspecifiedandyouexecuteaStartMotionVI.Specifiedtargetpositionshavenoeffectinvelocity
ClearFaultsClearsallmodalerrorsanddrivefaultsonallaxes.
Details
DeviceCompatibility
boardinisauniquenumberassignedbyMeasurement&AutomationExplorerusedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.UsetheerrorhandlerVIstolookupthemeaningofthiscodeanddisplaythecorrespondingerrormessage.sourceisastringthatindicatestheoriginoftheerror,ifany.Typically,sourceisthenameoftheVIinwhichtheerroroccurred.
boardoutisprovidedforflowcontrol.YoucanstringtogetherNI-MotionVIsbywiringtheboardoutterminalofoneVItotheboardinterminalofthenextVI.erroroutcontainserrorinformation.Iferrorinindicatesanerror,erroroutcontainsthesameerrorinformation.Otherwise,itdescribestheerror
UsingThisVI
UsethisVItoclearallmodalerrorsanddrivefaultsonallaxes.ThisVIpulsesthealarmclearlineonallaxesthathavemappedthealarmclearsignalusingConfigureMotionI/OMap.
NoteRefertoWriteMotionI/ODataformoreinformationaboutthealarmclearsignalandtochangethealarmclearpulsewidth.
Theinhibit-insignalisconnectedtotheAlarmsignalofthedrive.Monitorthestatusoftheinhibit-insignaltodetermineifthereareanydrivefaults.Correctthefaults,thenusethisVItoclearthealarmstateofthedrive.
TheInitializeControllerVIautomaticallycallsthisVIifthecontrollerisinapower-upstate.IfyoucallInitializeControllerandthecontrollerisnotinapower-upstate,thisVIisnotcalled.
ConfigureMotionI/OMapMapsageneralpurposeI/Olinetoanalternatefunctionofanaxis.
Details
DeviceCompatibility
attributeistheactiontomaptoadigitalI/Oline.Thefollowingarevalidattributes:
defaultinput—MapsageneralpurposeI/Olineasthedefaultinputline.defaultoutput—MapsageneralpurposeI/Olineasthedefaultoutputline.shutdown—Mapsageneralpurposeinputlineastheshutdown(E-Stop)line.RefertoEnableShutdownformoreinformationabouttheshutdown(E-Stop)functionalityofthecontroller.inhibit-out—Mapsageneralpurposeoutputlineasaninhibit-outline.RefertoConfigureInhibitOutputformoreinformationabouttheinhibitoutputs.alarmclear—Mapsageneralpurposeoutputlineasanalarmclearline.RefertoWriteMotionI/ODataformoreinformationaboutalarmclear.inhibit-in—Mapsageneralpurposeinputlineasaninhibit-inline.RefertoWriteMotionI/ODataformoreinformationaboutthe
UsingThisVI
ThisVImapsageneral-purposeI/Olinetoanalternatefunctionofanaxissuchasinhibitoutput.Forexample,tomapaxis3general-purposeoutput1totheinhibitoutputofaxis3,calltheVIwiththefollowingparametervalues:
axisin=3attribute=inhibit-outioAxisin=3linein=1
Notes
Forallattributesexceptforshutdown,theaxisininputmustbethesameastheioAxisininput.Theactionshutdownappliestothedevicelevel.Theaxisininputisignored.Furthermore,onlyonegeneral-purposeinputcanbemappedtothisattribute.7330,7340,and7350controllersdonotsupporttheinhibit-outandshutdownattributesbecausethesecontrollershavededicatedpinsforthesesignals.7390controllersdonotsupporttheinhibit-inandin-positionattributesbecausethiscontrollerhasdedicatedpinsforthesesignals.
Thefollowingtableliststhedrivesignalsandtheirimplementationonthecontroller:
SignalName SignalDirection
ControllerSupportController Drive 7330 7340 7350 7390Inhibit-Out ServoOn Output Dedicated Dedicated Dedicated Mappable
Inhibit-In ServoAlarm Input Mappable Mappable Mappable Dedicated
DriveReady
ServoReady Input Mappable Mappable Mappable Mappable
ResetMotionControllerResetsthemotioncontrollertothepower-upstate.
Details
DeviceCompatibility
boardinisauniquenumberassignedbyMeasurement&AutomationExplorerusedtosendandreceivecommandsanddatatoorfromaspecificNImotioncontroller.errorin(noerror)describeserrorconditionsthatoccurbeforethisVIruns.Thedefaultinputofthisclusterisnoerror.Ifanerroralreadyoccurred,thisVIreturnsthevalueoferrorininerrorout.TheVIrunsnormallyonlyifnoincomingerrorexists.Otherwise,theVIpassestheerrorinvaluetoerrorout.Theerrorinclustercontainsthefollowingparameters:
statusisTRUEifanerroroccurredbeforethisVIwascalled,orFALSEifnot.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.codeisanumberidentifyinganerrororwarning.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeiszeroorawarningcode.UsetheerrorhandlerVIstolookupthemeaningofthiscodeanddisplaythecorrespondingerrormessage.sourceisastringthatindicatestheoriginoftheerror,ifany.Typically,sourceisthenameoftheVIinwhichtheerroroccurred.
boardoutisprovidedforflowcontrol.YoucanstringtogetherNI-MotionVIsbywiringtheboardoutterminalofoneVItotheboardinterminalofthenextVI.
UsingThisVI
UsethisVItoresetthemotioncontrollertothepower-upstate.Afterresettingthecontroller,youmustcallInitializeControllerorClearPowerUpStatustousethecontroller.
ImportantInformationWarranty
Copyright
Trademarks
Patents
WarningRegardingUseofNIProducts
WarrantyThemediaonwhichyoureceiveNationalInstrumentssoftwarearewarrantednottofailtoexecuteprogramminginstructions,duetodefectsinmaterialsandworkmanship,foraperiodof90daysfromdateofshipment,asevidencedbyreceiptsorotherdocumentation.NationalInstrumentswill,atitsoption,repairorreplacesoftwaremediathatdonotexecuteprogramminginstructionsifNationalInstrumentsreceivesnoticeofsuchdefectsduringthewarrantyperiod.NationalInstrumentsdoesnotwarrantthattheoperationofthesoftwareshallbeuninterruptedorerrorfree.
AReturnMaterialAuthorization(RMA)numbermustbeobtainedfromthefactoryandclearlymarkedontheoutsideofthepackagebeforeanyequipmentwillbeacceptedforwarrantywork.NationalInstrumentswillpaytheshippingcostsofreturningtotheownerpartswhicharecoveredbywarranty.
NationalInstrumentsbelievesthattheinformationinthisdocumentisaccurate.Thedocumenthasbeencarefullyreviewedfortechnicalaccuracy.Intheeventthattechnicalortypographicalerrorsexist,NationalInstrumentsreservestherighttomakechangestosubsequenteditionsofthisdocumentwithoutpriornoticetoholdersofthisedition.ThereadershouldconsultNationalInstrumentsiferrorsaresuspected.InnoeventshallNationalInstrumentsbeliableforanydamagesarisingoutoforrelatedtothisdocumentortheinformationcontainedinit.
EXCEPTASSPECIFIEDHEREIN,NATIONALINSTRUMENTSMAKESNOWARRANTIES,EXPRESSORIMPLIED,ANDSPECIFICALLYDISCLAIMSANYWARRANTYOFMERCHANTABILITYORFITNESSFORAPARTICULARPURPOSE.CUSTOMER'SRIGHTTORECOVERDAMAGESCAUSEDBYFAULTORNEGLIGENCEONTHEPARTOFNATIONALINSTRUMENTSSHALLBELIMITEDTOTHEAMOUNTTHERETOFOREPAIDBYTHECUSTOMER.NATIONALINSTRUMENTSWILLNOTBELIABLEFORDAMAGESRESULTINGFROMLOSSOFDATA,PROFITS,USEOFPRODUCTS,ORINCIDENTALORCONSEQUENTIALDAMAGES,EVENIFADVISEDOFTHEPOSSIBILITYTHEREOF.ThislimitationoftheliabilityofNationalInstrumentswillapplyregardlessoftheformofaction,whetherincontractortort,including
negligence.AnyactionagainstNationalInstrumentsmustbebroughtwithinoneyearafterthecauseofactionaccrues.NationalInstrumentsshallnotbeliableforanydelayinperformanceduetocausesbeyonditsreasonablecontrol.Thewarrantyprovidedhereindoesnotcoverdamages,defects,malfunctions,orservicefailurescausedbyowner'sfailuretofollowtheNationalInstrumentsinstallation,operation,ormaintenanceinstructions;owner'smodificationoftheproduct;owner'sabuse,misuse,ornegligentacts;andpowerfailureorsurges,fire,flood,accident,actionsofthirdparties,orothereventsoutsidereasonablecontrol.
CopyrightUnderthecopyrightlaws,thispublicationmaynotbereproducedortransmittedinanyform,electronicormechanical,includingphotocopying,recording,storinginaninformationretrievalsystem,ortranslating,inwholeorinpart,withoutthepriorwrittenconsentofNationalInstrumentsCorporation.
NationalInstrumentsrespectstheintellectualpropertyofothers,andweaskouruserstodothesame.NIsoftwareisprotectedbycopyrightandotherintellectualpropertylaws.WhereNIsoftwaremaybeusedtoreproducesoftwareorothermaterialsbelongingtoothers,youmayuseNIsoftwareonlytoreproducematerialsthatyoumayreproduceinaccordancewiththetermsofanyapplicablelicenseorotherlegalrestriction.
TrademarksNationalInstruments,NI,ni.com,andLabVIEWaretrademarksofNationalInstrumentsCorporation.RefertotheTermsofUsesectiononni.com/legalformoreinformationaboutNationalInstrumentstrademarks.
FireWire®istheregisteredtrademarkofAppleComputer,Inc.
HandleGraphics®,MATLAB®,Real-TimeWorkshop®,Simulink®,Stateflow®,andxPCTargetBox®areregisteredtrademarks,andTargetBox™andTargetLanguageCompiler™aretrademarksofTheMathWorks,Inc.
Tektronix®andTekareregisteredtrademarksofTektronix,Inc.
Otherproductandcompanynamesmentionedhereinaretrademarksortradenamesoftheirrespectivecompanies.
MembersoftheNationalInstrumentsAlliancePartnerProgramarebusinessentitiesindependentfromNationalInstrumentsandhavenoagency,partnership,orjoint-venturerelationshipwithNationalInstruments.
PatentsForpatentscoveringNationalInstrumentsproducts,refertotheappropriatelocation:Help»Patentsinyoursoftware,thepatents.txtfileonyourCD,orni.com/patents.
WARNINGREGARDINGUSEOFNATIONALINSTRUMENTSPRODUCTS(1)NATIONALINSTRUMENTSPRODUCTSARENOTDESIGNEDWITHCOMPONENTSANDTESTINGFORALEVELOFRELIABILITYSUITABLEFORUSEINORINCONNECTIONWITHSURGICALIMPLANTSORASCRITICALCOMPONENTSINANYLIFESUPPORTSYSTEMSWHOSEFAILURETOPERFORMCANREASONABLYBEEXPECTEDTOCAUSESIGNIFICANTINJURYTOAHUMAN.
(2)INANYAPPLICATION,INCLUDINGTHEABOVE,RELIABILITYOFOPERATIONOFTHESOFTWAREPRODUCTSCANBEIMPAIREDBYADVERSEFACTORS,INCLUDINGBUTNOTLIMITEDTOFLUCTUATIONSINELECTRICALPOWERSUPPLY,COMPUTERHARDWAREMALFUNCTIONS,COMPUTEROPERATINGSYSTEMSOFTWAREFITNESS,FITNESSOFCOMPILERSANDDEVELOPMENTSOFTWAREUSEDTODEVELOPANAPPLICATION,INSTALLATIONERRORS,SOFTWAREANDHARDWARECOMPATIBILITYPROBLEMS,MALFUNCTIONSORFAILURESOFELECTRONICMONITORINGORCONTROLDEVICES,TRANSIENTFAILURESOFELECTRONICSYSTEMS(HARDWAREAND/ORSOFTWARE),UNANTICIPATEDUSESORMISUSES,ORERRORSONTHEPARTOFTHEUSERORAPPLICATIONSDESIGNER(ADVERSEFACTORSSUCHASTHESEAREHEREAFTERCOLLECTIVELYTERMED"SYSTEMFAILURES").ANYAPPLICATIONWHEREASYSTEMFAILUREWOULDCREATEARISKOFHARMTOPROPERTYORPERSONS(INCLUDINGTHERISKOFBODILYINJURYANDDEATH)SHOULDNOTBERELIANTSOLELYUPONONEFORMOFELECTRONICSYSTEMDUETOTHERISKOFSYSTEMFAILURE.TOAVOIDDAMAGE,INJURY,ORDEATH,THEUSERORAPPLICATIONDESIGNERMUSTTAKEREASONABLYPRUDENTSTEPSTOPROTECTAGAINSTSYSTEMFAILURES,INCLUDINGBUTNOTLIMITEDTOBACK-UPORSHUTDOWNMECHANISMS.BECAUSEEACHEND-USERSYSTEMISCUSTOMIZED
ANDDIFFERSFROMNATIONALINSTRUMENTS'TESTINGPLATFORMSANDBECAUSEAUSERORAPPLICATIONDESIGNERMAYUSENATIONALINSTRUMENTSPRODUCTSINCOMBINATIONWITHOTHERPRODUCTSINAMANNERNOTEVALUATEDORCONTEMPLATEDBYNATIONALINSTRUMENTS,THEUSERORAPPLICATIONDESIGNERISULTIMATELYRESPONSIBLEFORVERIFYINGANDVALIDATINGTHESUITABILITYOFNATIONALINSTRUMENTSPRODUCTSWHENEVERNATIONALINSTRUMENTSPRODUCTSAREINCORPORATEDINASYSTEMORAPPLICATION,INCLUDING,WITHOUTLIMITATION,THEAPPROPRIATEDESIGN,PROCESSANDSAFETYLEVELOFSUCHSYSTEMORAPPLICATION.
TechnicalSupportandProfessionalServicesVisitthefollowingsectionsoftheNationalInstrumentsWebsiteatni.comfortechnicalsupportandprofessionalservices:
Support—Onlinetechnicalsupportresourcesatni.com/supportincludethefollowing:
Self-HelpResources—Foranswersandsolutions,visittheaward-winningNationalInstrumentsWebsiteforsoftwaredriversandupdates,asearchableKnowledgeBase,productmanuals,step-by-steptroubleshootingwizards,thousandsofexampleprograms,tutorials,applicationnotes,instrumentdrivers,andsoon.FreeTechnicalSupport—AllregisteredusersreceivefreeBasicService,whichincludesaccesstohundredsofApplicationsEngineersworldwideintheNIDiscussionForumsatni.com/forums.NationalInstrumentsApplicationsEngineersmakesureeveryquestionreceivesananswer.
Forinformationaboutothertechnicalsupportoptionsinyourarea,visitni.com/servicesorcontactyourlocalofficeatni.com/contact.
TrainingandCertification—Visitni.com/trainingforself-pacedtraining,eLearningvirtualclassrooms,interactiveCDs,andCertificationprograminformation.Youalsocanregisterforinstructor-led,hands-oncoursesatlocationsaroundtheworld.SystemIntegration—Ifyouhavetimeconstraints,limitedin-housetechnicalresources,orotherprojectchallenges,NationalInstrumentsAlliancePartnermemberscanhelp.Tolearnmore,callyourlocalNIofficeorvisitni.com/alliance.
Ifyousearchedni.comandcouldnotfindtheanswersyouneed,contactyourlocalofficeorNIcorporateheadquarters.YoualsocanvisittheWorldwideOfficessectionofni.com/niglobaltoaccessthebranchofficeWebsites,whichprovideup-to-datecontactinformation,supportphonenumbers,emailaddresses,andcurrentevents.
NI7330and7340TimingInformationThefollowingtableliststheexecutiontimeforselectedVIs,aswellasforthedifferentattributesofthoseVIs,ifapplicable.Alsoincludedistiminginformationforaxesorvectorspaces,ifbotharesupportedwithagivenVI.
NoteThetimeslistedarebenchmarktimesandarenotaguaranteeofVIexecutiontimesonyoursystem.Timesdonottakeintoaccountotheroperations,onboardprograms,orotherfactorsthatslowperformance.
VI VIReturnTime(ms)using1.47GHzProcessor†
VIReturnTime(ms)using700MHzProcessor‡
LoadTargetPosition 1.1 1.2
ReadPosition 1.7 1.9ReadMotionI/OData
ForwardLimitActive
ReverseLimitActive
ForwardSoftwareLimitActive
ReverseSoftwareLimitActive
HomeInputActive
Inhibit-InActive
1.3
1.3
1.4
1.4
1.6
1.6
1.6
1.4
1.4
1.5
1.5
1.7
1.7
1.7
In-PositionActive
DriveReadyActive
Inhibit-OutActive
1.6
1.6
1.7
1.7
ReadI/OPort 1.3 1.4SetI/OPortMOMO 1.1 1.2
LoadVectorSpacePosition 1.1 1.2
ReadVelocity
axis
vector1.8
1.9
1.8
1.9
ReadVelocityinRPM
axis
vector2.0
2.1
2.1
2.2
LoadVelocity
axis
vector1.2
1.2
1.3
1.3
LoadVelocityinRPM
axis
vector 2.7
2.8
2.8
2.9
ReadMoveCompleteStatus 0.1 0.2
ConfigureVectorSpace 1.3 1.4
CheckMoveCompleteStatus 1.6 1.7
CheckBlendCompleteStatus 1.4 1.5
ReadCommunicationStatus
0.1 0.2
InitializeController 607.1 607.1
ReadDigitalI/OData
OutputActiveState
InputActiveState
OutputActive
InputActive
ConfigureAsInput
1.4
1.4
1.4
1.4
1.4
1.5
1.5
1.5
1.5
1.5
ReadFollowingError 1.8 1.9
†AnAMDAthlon1.47GHzPCwith256MBofRAMwasusedfortiming
tests.Testsrunin"abovenormalpriority"executiontoachievethemostaccurateresults.
‡AnIntelPentium3700MHzPCwith386MBofRAMwasusedfortimingtests.Testsrunin"abovenormalpriority"executiontoachievethemostaccurateresults.
NI7334,7342,and7344TimingInformationThefollowingtableliststheexecutiontimeforselectedVIs,aswellasforthedifferentattributesofthoseVIs,ifapplicable.Alsoincludedistiminginformationforaxesorvectorspaces,ifbotharesupportedwithagivenVI.
NoteThetimeslistedarebenchmarktimesandarenotaguaranteeofVIexecutiontimesonyoursystem.Timesdonottakeintoaccountotheroperations,onboardprograms,orotherfactorsthatslowperformance.
VI VIReturnTime(ms)using1.47GHzProcessor†
VIReturnTime(ms)using700MHzProcessor‡
LoadTargetPosition 1.1 1.2
ReadPosition 1.9 1.9ReadI/OPort 1.6 1.7SetI/OPortMOMO 1.1 1.2
LoadVectorSpacePosition 1.3 1.4
ReadVelocity
axis
vector1.9
2.02.0
2.1
ReadVelocityinRPM
axis 2.1 2.2
vector 2.1 2.2
LoadVelocity
axis
vector1.5
1.2
1.6
1.3
LoadVelocityinRPM
axis
vector3.4
1.9
3.5
1.9
ReadMoveCompleteStatus 0.1 0.1
ConfigureVectorSpace 1.7 1.8
CheckMoveCompleteStatus 1.5 1.6
CheckBlendCompleteStatus 1.6 1.7
ReadCommunicationStatus
0.1 0.1
InitializeController 620.4 620.4
ReadFollowingError 1.8 1.8
†AnAMDAthlon1.47GHzPCwith256MBofRAMwasusedfortimingtests.Testsrunin"abovenormalpriority"executiontoachievethemostaccurateresults.
‡AnIntelPentium3700MHzPCwith386MBofRAMwasusedfortimingtests.Testsrunin"abovenormalpriority"executiontoachievethemostaccurateresults.
NI7350TimingInformationThefollowingtableliststheexecutiontimeforselectedVIs,aswellasforthedifferentattributesofthoseVIs,ifapplicable.Alsoincludedistiminginformationforaxesorvectorspaces,ifbotharesupportedwithagivenVI.
NoteThetimeslistedarebenchmarktimesandarenotaguaranteeofVIexecutiontimesonyoursystem.Timesdonottakeintoaccountotheroperations,onboardprograms,orotherfactorsthatslowperformance.
VI VIReturnTime(ms)using1.47GHzProcessor†
VIReturnTime(ms)using700MHzProcessor‡
LoadTargetPosition 1.1 1.2
ReadPosition 0.1 0.1
ReadAxisData
Position
Velocity
FollowingError
0.1
0.1
0.1
0.2
0.2
0.2
ReadAxisStatus
AxisActive
MoveComplete
ProfileComplete
BlendComplete
FollowingError
0.1
0.1
0.1
0.1
0.2
0.2
0.2
0.2
VelocityThresholdReached
Moving
DirectionForward
0.1
0.1
0.1
0.1
0.2
0.2
0.2
0.2
ReadAllAxisData 0.2 0.3
ReadAllAxisStatus 0.1 0.2
ReadCoordinateData
Velocity
FollowingError0.2
0.2
0.3
0.3
ReadCoordinatePosition 0.3 0.3
ReadEncoderData
Position
IndexPosition
IndexCapture
0.1
1.6
0.1
0.2
1.7
0.2
ReadMotionI/OData
ForwardLimitActive
ReverseLimit
Active
ForwardSoftwareLimitActive
ReverseSoftwareLimitActive
HomeInputActive
Inhibit-InActive
In-PositionActive
DriveReadyActive
Inhibit-OutActive
0.1
0.1
0.1
0.1
0.1
1.5
1.5
1.5
1.5
0.2
0.2
0.2
0.2
0.2
1.6
1.6
1.6
1.6
ReadCaptureCompareData
CapturedPosition
CaptureStatus
CompareStatus
1.6
0.1
0.1
1.7
0.2
0.2
ReadI/OPort 0.2 0.3SetI/OPortMOMO 1.1 1.2
LoadVectorSpacePosition 1.2 1.3
ReadVelocity
axis
vector 0.1
0.2
0.2
0.3
ReadVelocityinRPM
axis
vector0.1
0.2
0.2
0.3
LoadVelocity
axis
vector1.3
1.1
1.4
1.2
LoadVelocityinRPM
axis
vector3.1
1.8
3.2
1.8
ReadMoveCompleteStatus 0.1 0.1
ConfigureVectorSpace 1.8 1.8
CheckMoveCompleteStatus 1.5 1.6
CheckBlendCompleteStatus 1.5 1.6
ReadCommunicationStatus
0.1 0.1
InitializeController 1218.0 1218.0
ReadCoordinateStatus
MoveComplete
ProfileComplete
BlendComplete
FollowingErrorExceeded
0.2
0.2
0.2
0.2
0.3
0.3
0.3
0.3
ReadDigitalI/OData
OutputActiveState
InputActiveState
OutputActive
InputActive
ConfigureAsInput
1.3
1.3
0.2
0.2
1.3
1.3
1.3
0.2
0.2
1.3
ReadFollowingError 2.1 2.1
†AnAMDAthlon1.47GHzPCwith256MBofRAMwasusedfortimingtests.Testsrunin"abovenormalpriority"executiontoachievethemostaccurateresults.
‡AnIntelPentium3700MHzPCwith386MBofRAMwasusedfortimingtests.Testsrunin"abovenormalpriority"executiontoachievethemostaccurateresults.
NI7390TimingInformationThefollowingtableliststheexecutiontimeforselectedVIs,aswellasforthedifferentattributesofthoseVIs,ifapplicable.Alsoincludedistiminginformationforaxesorvectorspaces,ifbotharesupportedwithagivenVI.
NoteThetimeslistedarebenchmarktimesandarenotaguaranteeofVIexecutiontimesonyoursystem.Timesdonottakeintoaccountotheroperations,onboardprograms,orotherfactorsthatslowperformance.
VI VIReturnTime(ms)using1.47GHzProcessor†
VIReturnTime(ms)using700MHzProcessor‡
LoadTargetPosition 1.1 1.2
ReadPosition 0.1 0.2
ReadAxisData
Position
Velocity
FollowingError
0.1
0.1
0.1
0.2
0.2
0.2
ReadAxisStatus
AxisActive
MoveComplete
ProfileComplete
BlendComplete
FollowingError
0.1
0.1
0.1
0.1
0.2
0.2
0.2
0.2
VelocityThresholdReached
Moving
DirectionForward
0.1
0.1
0.1
0.1
0.2
0.2
0.2
0.2
ReadAllAxisData 0.2 0.3
ReadAllAxisStatus 0.1 0.2
ReadCoordinateData
Velocity
FollowingError0.2
0.3
0.3
0.4
ReadCoordinatePosition 0.2 0.3
ReadEncoderData
Position
IndexPosition
IndexCapture
0.1
1.5
0.1
0.2
1.6
0.2
ReadMotionI/OData
ForwardLimitActive
ReverseLimit
Active
ForwardSoftwareLimitActive
ReverseSoftwareLimitActive
HomeInputActive
Inhibit-InActive
In-PositionActive
DriveReadyActive
Inhibit-OutActive
0.1
0.1
0.1
0.1
0.1
1.3
1.3
1.3
1.3
0.2
0.2
0.2
0.2
0.2
1.4
1.4
1.4
1.4
ReadCaptureCompareData
CapturedPosition
CaptureStatus
CompareStatus
1.5
0.1
0.1
1.6
0.2
0.2
ReadI/OPort 0.2 0.3SetI/OPortMOMO 1.0 1.1
LoadVectorSpacePosition 1.1 1.2
ReadVelocity
axis
vector 0.1
0.2
0.2
0.3
ReadVelocityinRPM
axis
vector0.1
0.2
0.2
0.3
LoadVelocity
axis
vector1.2
1.1
1.3
1.2
LoadVelocityinRPM
axis
vector2.7
1.5
2.7
1.6
ReadMoveCompleteStatus 0.1 0.1
ConfigureVectorSpace 1.4 1.5
CheckMoveCompleteStatus 1.5 1.6
CheckBlendCompleteStatus 1.4 1.4
ReadCommunicationStatus
0.1 0.1
InitializeController 565.5 608.5
ReadCoordinateStatus
MoveComplete
ProfileComplete
BlendComplete
FollowingErrorExceeded
0.2
0.2
0.2
0.2
0.3
0.3
0.3
0.3
ReadDigitalI/OData
OutputActiveState
InputActiveState
OutputActive
InputActive
1.3
1.3
0.2
0.2
1.4
1.4
0.3
0.3
ReadFollowingError 2.1 2.1
†AnAMDAthlon1.47GHzPCwith256MBofRAMwasusedfortimingtests.Testsrunin"abovenormalpriority"executiontoachievethemostaccurateresults.
‡AnIntelPentium3700MHzPCwith386MBofRAMwasusedfortimingtests.Testsrunin"abovenormalpriority"executiontoachievethemostaccurateresults.
BranchOfficesOffice TelephoneNumber
Australia 1800300800Austria 43662457990-0Belgium 32(0)27570020Brazil 551132623599Canada 8004333488China 862165557838CzechRepublic 420224235774Denmark 4545762600Finland 385(0)972572511France 33(0)148142424Germany 49897413130India 918041190000Israel 972036393737Italy 3902413091Japan 81354722970Korea 820234513400Lebanon 961(0)1332828Malaysia 1800887710Mexico 018000100793Netherlands 31(0)348433466NewZealand 0800553322Norway 47(0)66907660Poland 48223390150Portugal 351210311210Russia 74957836851Singapore 18002265886Slovenia 38634254200SouthAfrica 270118058197
Spain 34916400085Sweden 46(0)858789500Switzerland 41562005151Taiwan 8860223772222Thailand 6622786777Turkey 902122793031UnitedKingdom 44(0)1635523545UnitedStates(Corporate) 5126830100