Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file...
Transcript of Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file...
ModbusLabVIEWLibraryHelpFebruary2009,372767A-01ThishelpfiledescribestheModbusLabVIEWVIlibrary.Formoreinformationaboutthishelpfile,refertothefollowingtopics:UsingHelpImportantInformationTechnicalSupportandProfessionalServicesTocommentonNationalInstrumentsdocumentation,refertotheNationalInstrumentsWebsite.©2009NationalInstrumentsCorporation.Allrightsreserved.
UsingHelpConventionsNavigatingHelpSearchingHelpPrintingHelpFileTopics
ConventionsThishelpfileusesthefollowingformattingandtypographicalconventions:
Thisicondenotesanote,whichalertsyoutoimportantinformation.Thisicondenotesatip,whichalertsyoutoadvisoryinformation.
bold Boldtextdenotesitemsthatyoumustselectorclickinthesoftware,suchasmenuitemsanddialogboxoptions.Boldtextalsodenotesparameternames.
green Underlinedtextinthiscolordenotesalinktoahelptopic,helpfile,orWebaddress.
purple Underlinedtextinthiscolordenotesavisitedlinktoahelptopic,helpfile,orWebaddress.
italic Italictextdenotesvariables,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:
NoteTheinformationinthistopiconlyappliestothehelpfileinstalledwiththeWindowsversionofthesoftware.Hide—Hidesthenavigationpanefromview.Locate—LocatesthecurrentlydisplayedtopicintheContentstab,allowingyoutoviewrelatedtopics.Back—Displaysthepreviouslyviewedtopic.Forward—DisplaysthetopicyouviewedbeforeclickingtheBackbutton.Options—Displaysalistofcommandsandviewingoptionsforthehelpfile.
SearchingHelp(WindowsOnly)UsetheSearchtabtotheleftofthiswindowtolocatecontentinthishelpfile.
NoteTheinformationinthistopiconlyappliestothehelpfileinstalledwiththeWindowsversionofthesoftware.
Ifyouwanttosearchforwordsinacertainorder,suchas"relateddocumentation,"addquotationmarksaroundthesearchwordsasshownintheexample.SearchingfortermsontheSearchtaballowsyoutoquicklylocatespecificinformationandinformationintopicsthatarenotincludedontheContentstab.
TipYoucantemporarilydisablethesearchhighlightingfeaturebyselectingOptions»SearchHighlightOfffromthetoolbar.
WildcardsYoualsocansearchusingasterisk(*)orquestionmark(?)wildcards.Usetheasteriskwildcardtoreturntopicsthatcontainacertainstring.Forexample,asearchfor"prog*"liststopicsthatcontainthewords"program,""programmatically,""progress,"andsoon.Usethequestionmarkwildcardasasubstituteforasinglecharacterinasearchterm.Forexample,"?ext"liststopicsthatcontainthewords"next,""text,"andsoon.
NoteWildcardsearchingwillnotworkonSimplifiedChinese,TraditionalChinese,Japanese,andKoreansystems.
NestedExpressionsUsenestedexpressionstocombinesearchestofurtherrefineasearch.YoucanuseBooleanexpressionsandwildcardsinanestedexpression.Forexample,"exampleAND(programORVI)"liststopicsthatcontain"exampleprogram"or"exampleVI."Youcannotnestexpressionsmorethanfivelevels.
BooleanExpressionsClickthe 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:
NoteTheinformationinthistopiconlyappliestothehelpfileinstalledwiththeWindowsversionofthesoftware.
1. Right-clickthebook.2. SelectPrintfromtheshortcutmenutodisplaythePrintTopics
dialogbox.3. SelectthePrinttheselectedheadingandallsubtopicsoption.
NoteSelectPrinttheselectedtopicifyouwanttoprintthesingletopicyouhaveselectedintheContentstab.
4. ClicktheOKbutton.
PrintingPDFDocumentsThishelpfilemaycontainlinkstoPDFdocuments.ToprintPDFdocuments,clicktheprintbuttonlocatedontheAdobeAcrobatViewertoolbar.
MBEthernetMasterQueryReadCoils(poly).viThemasterusesthisVIreadtheslaves'coils.Thiscorrespondstoapublicfunctioncodeof1intheMODBUSprotocol.
MBAPHeaderisaclustercontainingthetransactionIDandUnitID.ThisisadditionalinformationnotusuallyrequiredforaMODBUStransaction.
TransactionIdentifier—Thisidentifierisfortransactionpairing;theMODBUSservercopiestherequesttransactionidentifierintheresponse.UnitIdentifier—Thisfieldisforintra-systemroutingpurposes.IttypicallycommunicatestoaMODBUSseriallineslavethroughagatewaybetweenanEthernetTCP-IPnetworkandaMODBUSserialline.TheMODBUSclientsetsthisfieldintherequest,andtheserverresponsemustreturnthisfieldwiththesamevalue.
TCPConnectionRefnuminisanetworkconnectionrefnumthatuniquelyidentifiestheTCPconnection.UseTCPOpenConnection.vitoopenaTCPconnection.StartingAddressisthefirstaddresslocationofthecoiltoread.Thisaddressissometimesreferredtoasoffset.Refertoyourdevice'sdocumentationtofindthecoiladdressmapping.
BesuretospecifythecorrectaddressintheMODBUSdeviceconfigurationsoftwarefortheregisteryouwanttouseinLabVIEW.InmostMODBUSdeviceconfigurationsoftware,youmustenteranamefortheregisteryouwanttouse.PerMODBUSconvention,theregisteraddressoftheslavedeviceiscalculatedbysubtracting1fromtheregisternamethatyouspecifyinthemasterdeviceconfigurationsoftware.TheMODBUSLabVIEWlibraryexpectsregisteraddresses,notregisternames,soyoumayneedtosubtract1fromtheaddressyoudefinedintheMODBUSdevice
configurationsoftware.Forexample,aregisternamedefinedas2inaMODBUSconfigurationdevicetranslatestoregisteraddress1intheHoldingRegisterstableoftheLabVIEWMODBUSlibrary,asshownbelow.MODBUSDevice
HoldingRegisterName=2
LabVIEW HoldingRegisterAddress=1
Quantityrepresentshowmanycoilstoreadfromtheslave.TheVIreturnsthecoilatStartingAddressandeachfollowingcoiluptoQuantity.Forexample,ifStartingAddressis0andQuantityis4,theVIreadscoilsfromtheslaveataddress0,1,2,and3.Timeoutspecifiesthemaximumtimeperiod,inmilliseconds,thattheVIwaitsfortheslave'sresponsebeforethrowinganerror.errorindescribeserrorconditionsthatoccurbeforethisVIorfunctionruns.Thedefaultisnoerror.IfanerroroccurredbeforethisVIorfunctionruns,theVIorfunctionpassestheerrorinvaluetoerrorout.IfanerroroccurswhilethisVIorfunctionruns,theVIorfunctionrunsnormallyandsetsitsownerrorstatusinerrorout.UsetheSimpleErrorHandlerorGeneralErrorHandlerVIstodisplaythedescriptionoftheerrorcode.Useerrorinanderrorouttocheckerrorsandtospecifyexecutionorderbywiringerroroutfromonenodetoerrorinofthenextnode.
statusisTRUE(X)ifanerroroccurredbeforethisVIorfunctionranorFALSE(checkmark)toindicateawarningorthatnoerroroccurredbeforethisVIorfunctionran.ThedefaultisFALSE.codeistheerrororwarningcode.Thedefaultis0.IfstatusisTRUE,codeisanegativeerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourceidentifieswhereanerroroccurred.ThesourcestringincludesthenameoftheVIthatproducedtheerror,whatinputsareinerror,andhowtoeliminatetheerror.
TCPConnectionRefnum(dup)canbeaninputtoanotherMODBUSVI,oryoucancloseitusingTCPCloseConnection.vi.
Coilsrepresentsthedatareadfromtheslave.
ExceptionCodeisnonzeroifaMODBUSerrorhasoccurred.Theexceptioncodemappingisasfollows:0 Noerror1 Illegalfunction2 Illegaldataaddress3 Illegaldatavalue4 Failureinassociateddevice5 Acknowledge6 Busy,rejectedmessage7 NAK—NegativeacknowledgeFormoreinformationabouttheseerrorcodes,refertoyourdevice'sdocumentation.erroroutcontainserrorinformation.IferrorinindicatesthatanerroroccurredbeforethisVIorfunctionran,erroroutcontainsthesameerrorinformation.Otherwise,itdescribestheerrorstatusthatthisVIorfunctionproduces.Right-clicktheerroroutfrontpanelindicatorandselectExplainErrorfromtheshortcutmenuformoreinformationabouttheerror.
statusisTRUE(X)ifanerroroccurredorFALSE(checkmark)toindicateawarningorthatnoerroroccurred.codeistheerrororwarningcode.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourcedescribestheoriginoftheerrororwarningandis,inmostcases,thenameoftheVIorfunctionthatproducedtheerrororwarning.
MBEthernetMasterQueryReadDiscreteInputs(poly).viThemasterusesthisVItoreadtheslaves'discreteinputs.Thiscorrespondstoapublicfunctioncodeof2intheMODBUSprotocol.
MBAPHeaderisaclustercontainingthetransactionIDandUnitID.ThisisadditionalinformationnotusuallyrequiredforaMODBUStransaction.
TransactionIdentifier—Thisidentifierisfortransactionpairing;theMODBUSservercopiestherequesttransactionidentifierintheresponse.UnitIdentifier—Thisfieldisforintra-systemroutingpurposes.IttypicallycommunicatestoaMODBUSseriallineslavethroughagatewaybetweenanEthernetTCP-IPnetworkandaMODBUSserialline.TheMODBUSclientsetsthisfieldintherequest,andtheserverresponsemustreturnthisfieldwiththesamevalue.
TCPConnectionRefnuminisanetworkconnectionrefnumthatuniquelyidentifiestheTCPconnection.UseTCPOpenConnection.vitoopenaTCPconnection.StartingAddressisthefirstaddresslocationofthediscreteinputstoread.Thisaddressissometimesreferredtoasoffset.Refertoyourdevice'sdocumentationtofindthediscreteinputaddressmapping.
BesuretospecifythecorrectaddressintheMODBUSdeviceconfigurationsoftwarefortheregisteryouwanttouseinLabVIEW.InmostMODBUSdeviceconfigurationsoftware,youmustenteranamefortheregisteryouwanttouse.PerMODBUSconvention,theregisteraddressoftheslavedeviceiscalculatedbysubtracting1fromtheregisternamethatyouspecifyinthemasterdeviceconfigurationsoftware.TheMODBUSLabVIEWlibrary
expectsregisteraddresses,notregisternames,soyoumayneedtosubtract1fromtheaddressyoudefinedintheMODBUSdeviceconfigurationsoftware.Forexample,aregisternamedefinedas2inaMODBUSconfigurationdevicetranslatestoregisteraddress1intheHoldingRegisterstableoftheLabVIEWMODBUSlibrary,asshownbelow.MODBUSDevice
HoldingRegisterName=2
LabVIEW HoldingRegisterAddress=1
Quantityrepresentshowmanydiscreteinputstoreadfromtheslave.TheVIreturnsthediscreteinputatStartingAddressandeachfollowingdiscreteinputuptoQuantity.Forexample,ifStartingAddressis0andQuantityis4,theVIreadsdiscreteinputsfromtheslaveataddress0,1,2,and3.Timeoutspecifiesthemaximumtimeperiod,inmilliseconds,thattheVIwaitsfortheslave'sresponsebeforethrowinganerror.errorindescribeserrorconditionsthatoccurbeforethisVIorfunctionruns.Thedefaultisnoerror.IfanerroroccurredbeforethisVIorfunctionruns,theVIorfunctionpassestheerrorinvaluetoerrorout.IfanerroroccurswhilethisVIorfunctionruns,theVIorfunctionrunsnormallyandsetsitsownerrorstatusinerrorout.UsetheSimpleErrorHandlerorGeneralErrorHandlerVIstodisplaythedescriptionoftheerrorcode.Useerrorinanderrorouttocheckerrorsandtospecifyexecutionorderbywiringerroroutfromonenodetoerrorinofthenextnode.
statusisTRUE(X)ifanerroroccurredbeforethisVIorfunctionranorFALSE(checkmark)toindicateawarningorthatnoerroroccurredbeforethisVIorfunctionran.ThedefaultisFALSE.codeistheerrororwarningcode.Thedefaultis0.IfstatusisTRUE,codeisanegativeerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourceidentifieswhereanerroroccurred.ThesourcestringincludesthenameoftheVIthatproducedtheerror,whatinputsareinerror,andhowtoeliminatetheerror.
TCPConnectionRefnum(dup)canbeaninputtoanotherMODBUSVI,oryoucancloseitusingTCPCloseConnection.vi.DiscreteInputsrepresentsthedatareadfromtheslave.ExceptionCodeisnonzeroifaMODBUSerrorhasoccurred.Theexceptioncodemappingisasfollows:0 Noerror1 Illegalfunction2 Illegaldataaddress3 Illegaldatavalue4 Failureinassociateddevice5 Acknowledge6 Busy,rejectedmessage7 NAK—NegativeacknowledgeFormoreinformationabouttheseerrorcodes,refertoyourdevice'sdocumentation.erroroutcontainserrorinformation.IferrorinindicatesthatanerroroccurredbeforethisVIorfunctionran,erroroutcontainsthesameerrorinformation.Otherwise,itdescribestheerrorstatusthatthisVIorfunctionproduces.Right-clicktheerroroutfrontpanelindicatorandselectExplainErrorfromtheshortcutmenuformoreinformationabouttheerror.
statusisTRUE(X)ifanerroroccurredorFALSE(checkmark)toindicateawarningorthatnoerroroccurred.codeistheerrororwarningcode.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourcedescribestheoriginoftheerrororwarningandis,inmostcases,thenameoftheVIorfunctionthatproducedtheerrororwarning.
MBEthernetMasterQueryReadExceptionStatus(poly).viThemasterusesthisVItoreadtheexceptionstatusfromtheslave.Thiscorrespondstoapublicfunctioncodeof7intheMODBUSprotocol.
MBAPHeaderisaclustercontainingthetransactionIDandUnitID.ThisisadditionalinformationnotusuallyrequiredforaMODBUStransaction.
TransactionIdentifier—Thisidentifierisfortransactionpairing;theMODBUSservercopiestherequesttransactionidentifierintheresponse.UnitIdentifier—Thisfieldisforintra-systemroutingpurposes.IttypicallycommunicatestoaMODBUSseriallineslavethroughagatewaybetweenanEthernetTCP-IPnetworkandaMODBUSserialline.TheMODBUSclientsetsthisfieldintherequest,andtheserverresponsemustreturnthisfieldwiththesamevalue.
TCPConnectionRefnuminisanetworkconnectionrefnumthatuniquelyidentifiestheTCPconnection.UseTCPOpenConnection.vitoopenaTCPconnection.Timeoutspecifiesthemaximumtimeperiod,inmilliseconds,thattheVIwaitsfortheslave'sresponsebeforethrowinganerror.errorindescribeserrorconditionsthatoccurbeforethisVIorfunctionruns.Thedefaultisnoerror.IfanerroroccurredbeforethisVIorfunctionruns,theVIorfunctionpassestheerrorinvaluetoerrorout.IfanerroroccurswhilethisVIorfunctionruns,theVIorfunctionrunsnormallyandsetsitsownerrorstatusinerrorout.UsetheSimpleErrorHandlerorGeneralErrorHandlerVIstodisplaythedescriptionoftheerrorcode.Useerrorinanderrorouttocheckerrorsandtospecifyexecutionorderbywiringerroroutfromonenodetoerrorinofthenextnode.
statusisTRUE(X)ifanerroroccurredbeforethisVIor
functionranorFALSE(checkmark)toindicateawarningorthatnoerroroccurredbeforethisVIorfunctionran.ThedefaultisFALSE.codeistheerrororwarningcode.Thedefaultis0.IfstatusisTRUE,codeisanegativeerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourceidentifieswhereanerroroccurred.ThesourcestringincludesthenameoftheVIthatproducedtheerror,whatinputsareinerror,andhowtoeliminatetheerror.
TCPConnectionRefnum(dup)canbeaninputtoanotherMODBUSVI,oryoucancloseitusingTCPCloseConnection.vi.ExceptionCodeisnonzeroifaMODBUSerrorhasoccurred.Theexceptioncodemappingisasfollows:0 Noerror1 Illegalfunction2 Illegaldataaddress3 Illegaldatavalue4 Failureinassociateddevice5 Acknowledge6 Busy,rejectedmessage7 NAK—NegativeacknowledgeFormoreinformationabouttheseerrorcodes,refertoyourdevice'sdocumentation.erroroutcontainserrorinformation.IferrorinindicatesthatanerroroccurredbeforethisVIorfunctionran,erroroutcontainsthesameerrorinformation.Otherwise,itdescribestheerrorstatusthatthisVIorfunctionproduces.Right-clicktheerroroutfrontpanelindicatorandselectExplainErrorfromtheshortcutmenuformoreinformationabouttheerror.
statusisTRUE(X)ifanerroroccurredorFALSE(checkmark)toindicateawarningorthatnoerroroccurred.codeistheerrororwarningcode.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeis0ora
warningcode.sourcedescribestheoriginoftheerrororwarningandis,inmostcases,thenameoftheVIorfunctionthatproducedtheerrororwarning.
MBEthernetMasterQueryReadHoldingRegisters(poly).viThemasterusesthisVItoreadtheslaves'holdingregisters.Thiscorrespondstoapublicfunctioncodeof3intheMODBUSprotocol.
MBAPHeaderisaclustercontainingthetransactionIDandUnitID.ThisisadditionalinformationnotusuallyrequiredforaMODBUStransaction.
TransactionIdentifier—Thisidentifierisfortransactionpairing;theMODBUSservercopiestherequesttransactionidentifierintheresponse.UnitIdentifier—Thisfieldisforintra-systemroutingpurposes.IttypicallycommunicatestoaMODBUSseriallineslavethroughagatewaybetweenanEthernetTCP-IPnetworkandaMODBUSserialline.TheMODBUSclientsetsthisfieldintherequest,andtheserverresponsemustreturnthisfieldwiththesamevalue.
TCPConnectionRefnuminisanetworkconnectionrefnumthatuniquelyidentifiestheTCPconnection.UseTCPOpenConnection.vitoopenaTCPconnection.StartingAddressisthefirstaddresslocationoftheholdingregistertoread.Thisaddressissometimesreferredtoasoffset.Refertoyourdevice'sdocumentationtofindtheholdingregisteraddressmapping.
BesuretospecifythecorrectaddressintheMODBUSdeviceconfigurationsoftwarefortheregisteryouwanttouseinLabVIEW.InmostMODBUSdeviceconfigurationsoftware,youmustenteranamefortheregisteryouwanttouse.PerMODBUSconvention,theregisteraddressoftheslavedeviceiscalculatedbysubtracting1fromtheregisternamethatyouspecifyinthemasterdeviceconfigurationsoftware.TheMODBUSLabVIEWlibrary
expectsregisteraddresses,notregisternames,soyoumayneedtosubtract1fromtheaddressyoudefinedintheMODBUSdeviceconfigurationsoftware.Forexample,aregisternamedefinedas2inaMODBUSconfigurationdevicetranslatestoregisteraddress1intheHoldingRegisterstableoftheLabVIEWMODBUSlibrary,asshownbelow.MODBUSDevice
HoldingRegisterName=2
LabVIEW HoldingRegisterAddress=1
Quantityrepresentshowmanyholdingregisterstoreadfromtheslave.TheVIreturnstheholdingregisteratStartingAddressandeachfollowingholdingregisteruptoQuantity.Forexample,ifStartingAddressis0andQuantityis4,theVIreadsholdingregistersfromtheslaveataddress0,1,2,and3.Timeoutspecifiesthemaximumtimeperiod,inmilliseconds,thattheVIwaitsfortheslave'sresponsebeforethrowinganerror.errorindescribeserrorconditionsthatoccurbeforethisVIorfunctionruns.Thedefaultisnoerror.IfanerroroccurredbeforethisVIorfunctionruns,theVIorfunctionpassestheerrorinvaluetoerrorout.IfanerroroccurswhilethisVIorfunctionruns,theVIorfunctionrunsnormallyandsetsitsownerrorstatusinerrorout.UsetheSimpleErrorHandlerorGeneralErrorHandlerVIstodisplaythedescriptionoftheerrorcode.Useerrorinanderrorouttocheckerrorsandtospecifyexecutionorderbywiringerroroutfromonenodetoerrorinofthenextnode.
statusisTRUE(X)ifanerroroccurredbeforethisVIorfunctionranorFALSE(checkmark)toindicateawarningorthatnoerroroccurredbeforethisVIorfunctionran.ThedefaultisFALSE.codeistheerrororwarningcode.Thedefaultis0.IfstatusisTRUE,codeisanegativeerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourceidentifieswhereanerroroccurred.ThesourcestringincludesthenameoftheVIthatproducedtheerror,whatinputsareinerror,andhowtoeliminatetheerror.
TCPConnectionRefnum(dup)canbeaninputtoanotherMODBUSVI,oryoucancloseitusingTCPCloseConnection.vi.HoldingRegistersrepresentsthedatareadfromtheslave.ExceptionCodeisnonzeroifaMODBUSerrorhasoccurred.Theexceptioncodemappingisasfollows:0 Noerror1 Illegalfunction2 Illegaldataaddress3 Illegaldatavalue4 Failureinassociateddevice5 Acknowledge6 Busy,rejectedmessage7 NAK—NegativeacknowledgeFormoreinformationabouttheseerrorcodes,refertoyourdevice'sdocumentation.erroroutcontainserrorinformation.IferrorinindicatesthatanerroroccurredbeforethisVIorfunctionran,erroroutcontainsthesameerrorinformation.Otherwise,itdescribestheerrorstatusthatthisVIorfunctionproduces.Right-clicktheerroroutfrontpanelindicatorandselectExplainErrorfromtheshortcutmenuformoreinformationabouttheerror.
statusisTRUE(X)ifanerroroccurredorFALSE(checkmark)toindicateawarningorthatnoerroroccurred.codeistheerrororwarningcode.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourcedescribestheoriginoftheerrororwarningandis,inmostcases,thenameoftheVIorfunctionthatproducedtheerrororwarning.
MBEthernetMasterQueryReadInputRegisters(poly).viThemasterusesthisVItoreadtheslaves'inputregisters.Thiscorrespondstoapublicfunctioncodeof4intheMODBUSprotocol.
MBAPHeaderisaclustercontainingthetransactionIDandUnitID.ThisisadditionalinformationnotusuallyrequiredforaMODBUStransaction.
TransactionIdentifier—Thisidentifierisfortransactionpairing;theMODBUSservercopiestherequesttransactionidentifierintheresponse.UnitIdentifier—Thisfieldisforintra-systemroutingpurposes.IttypicallycommunicatestoaMODBUSseriallineslavethroughagatewaybetweenanEthernetTCP-IPnetworkandaMODBUSserialline.TheMODBUSclientsetsthisfieldintherequest,andtheserverresponsemustreturnthisfieldwiththesamevalue.
TCPConnectionRefnuminisanetworkconnectionrefnumthatuniquelyidentifiestheTCPconnection.UseTCPOpenConnection.vitoopenaTCPconnection.StartingAddressisthefirstaddresslocationoftheinputregistertoread.Thisaddressissometimesreferredtoasoffset.Refertoyourdevice'sdocumentationtofindtheinputregisteraddressmapping.
BesuretospecifythecorrectaddressintheMODBUSdeviceconfigurationsoftwarefortheregisteryouwanttouseinLabVIEW.InmostMODBUSdeviceconfigurationsoftware,youmustenteranamefortheregisteryouwanttouse.PerMODBUSconvention,theregisteraddressoftheslavedeviceiscalculatedbysubtracting1fromtheregisternamethatyouspecifyinthemasterdeviceconfigurationsoftware.TheMODBUSLabVIEWlibrary
expectsregisteraddresses,notregisternames,soyoumayneedtosubtract1fromtheaddressyoudefinedintheMODBUSdeviceconfigurationsoftware.Forexample,aregisternamedefinedas2inaMODBUSconfigurationdevicetranslatestoregisteraddress1intheHoldingRegisterstableoftheLabVIEWMODBUSlibrary,asshownbelow.MODBUSDevice
HoldingRegisterName=2
LabVIEW HoldingRegisterAddress=1
Quantityrepresentshowmanyinputregisterstoreadfromtheslave.TheVIreturnstheinputregisteratStartingAddressandeachfollowinginputregisteruptoQuantity.Forexample,ifStartingAddressis0andQuantityis4,theVIreadsinputregistersfromtheslaveataddress0,1,2,and3.Timeoutspecifiesthemaximumtimeperiod,inmilliseconds,thattheVIwaitsfortheslave'sresponsebeforethrowinganerror.errorindescribeserrorconditionsthatoccurbeforethisVIorfunctionruns.Thedefaultisnoerror.IfanerroroccurredbeforethisVIorfunctionruns,theVIorfunctionpassestheerrorinvaluetoerrorout.IfanerroroccurswhilethisVIorfunctionruns,theVIorfunctionrunsnormallyandsetsitsownerrorstatusinerrorout.UsetheSimpleErrorHandlerorGeneralErrorHandlerVIstodisplaythedescriptionoftheerrorcode.Useerrorinanderrorouttocheckerrorsandtospecifyexecutionorderbywiringerroroutfromonenodetoerrorinofthenextnode.
statusisTRUE(X)ifanerroroccurredbeforethisVIorfunctionranorFALSE(checkmark)toindicateawarningorthatnoerroroccurredbeforethisVIorfunctionran.ThedefaultisFALSE.codeistheerrororwarningcode.Thedefaultis0.IfstatusisTRUE,codeisanegativeerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourceidentifieswhereanerroroccurred.ThesourcestringincludesthenameoftheVIthatproducedtheerror,whatinputsareinerror,andhowtoeliminatetheerror.
TCPConnectionRefnum(dup)canbeaninputtoanotherMODBUSVI,oryoucancloseitusingTCPCloseConnection.vi.InputRegistersrepresentsthedatareadfromtheslave.ExceptionCodeisnonzeroifaMODBUSerrorhasoccurred.Theexceptioncodemappingisasfollows:0 Noerror1 Illegalfunction2 Illegaldataaddress3 Illegaldatavalue4 Failureinassociateddevice5 Acknowledge6 Busy,rejectedmessage7 NAK—NegativeacknowledgeFormoreinformationabouttheseerrorcodes,refertoyourdevice'sdocumentation.erroroutcontainserrorinformation.IferrorinindicatesthatanerroroccurredbeforethisVIorfunctionran,erroroutcontainsthesameerrorinformation.Otherwise,itdescribestheerrorstatusthatthisVIorfunctionproduces.Right-clicktheerroroutfrontpanelindicatorandselectExplainErrorfromtheshortcutmenuformoreinformationabouttheerror.
statusisTRUE(X)ifanerroroccurredorFALSE(checkmark)toindicateawarningorthatnoerroroccurred.codeistheerrororwarningcode.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourcedescribestheoriginoftheerrororwarningandis,inmostcases,thenameoftheVIorfunctionthatproducedtheerrororwarning.
MBEthernetMasterQueryWriteMultipleCoils(poly).viThemasterusesthisVItowritemultiplecoilstotheslave.Thiscorrespondstoapublicfunctioncodeof15intheMODBUSprotocol.
MBAPHeaderisaclustercontainingthetransactionIDandUnitID.ThisisadditionalinformationnotusuallyrequiredforaMODBUStransaction.
TransactionIdentifier—Thisidentifierisfortransactionpairing;theMODBUSservercopiestherequesttransactionidentifierintheresponse.UnitIdentifier—Thisfieldisforintra-systemroutingpurposes.IttypicallycommunicatestoaMODBUSseriallineslavethroughagatewaybetweenanEthernetTCP-IPnetworkandaMODBUSserialline.TheMODBUSclientsetsthisfieldintherequest,andtheserverresponsemustreturnthisfieldwiththesamevalue.
TCPConnectionRefnuminisanetworkconnectionrefnumthatuniquelyidentifiestheTCPconnection.UseTCPOpenConnection.vitoopenaTCPconnection.StartingAddressistheaddresslocationofthefirstcoiltowrite.Thisaddressissometimesreferredtoasoffset.Refertoyourdevice'sdocumentationtofindthecoiladdressmapping.
BesuretospecifythecorrectaddressintheMODBUSdeviceconfigurationsoftwarefortheregisteryouwanttouseinLabVIEW.InmostMODBUSdeviceconfigurationsoftware,youmustenteranamefortheregisteryouwanttouse.PerMODBUSconvention,theregisteraddressoftheslavedeviceiscalculatedbysubtracting1fromtheregisternamethatyouspecifyinthemasterdeviceconfigurationsoftware.TheMODBUSLabVIEWlibraryexpectsregisteraddresses,notregisternames,soyoumayneed
tosubtract1fromtheaddressyoudefinedintheMODBUSdeviceconfigurationsoftware.Forexample,aregisternamedefinedas2inaMODBUSconfigurationdevicetranslatestoregisteraddress1intheHoldingRegisterstableoftheLabVIEWMODBUSlibrary,asshownbelow.MODBUSDevice
HoldingRegisterName=2
LabVIEW HoldingRegisterAddress=1
Coilsisthecoilstowrite.Thearraylengthrepresentsthenumberofcoilsthatwillbewritten.Timeoutspecifiesthemaximumtimeperiod,inmilliseconds,thattheVIwaitsfortheslave'sresponsebeforethrowinganerror.errorindescribeserrorconditionsthatoccurbeforethisVIorfunctionruns.Thedefaultisnoerror.IfanerroroccurredbeforethisVIorfunctionruns,theVIorfunctionpassestheerrorinvaluetoerrorout.IfanerroroccurswhilethisVIorfunctionruns,theVIorfunctionrunsnormallyandsetsitsownerrorstatusinerrorout.UsetheSimpleErrorHandlerorGeneralErrorHandlerVIstodisplaythedescriptionoftheerrorcode.Useerrorinanderrorouttocheckerrorsandtospecifyexecutionorderbywiringerroroutfromonenodetoerrorinofthenextnode.
statusisTRUE(X)ifanerroroccurredbeforethisVIorfunctionranorFALSE(checkmark)toindicateawarningorthatnoerroroccurredbeforethisVIorfunctionran.ThedefaultisFALSE.codeistheerrororwarningcode.Thedefaultis0.IfstatusisTRUE,codeisanegativeerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourceidentifieswhereanerroroccurred.ThesourcestringincludesthenameoftheVIthatproducedtheerror,whatinputsareinerror,andhowtoeliminatetheerror.
TCPConnectionRefnum(dup)canbeaninputtoanotherMODBUSVI,oryoucancloseitusingTCPCloseConnection.vi.
ExceptionCodeisnonzeroifaMODBUSerrorhasoccurred.The
exceptioncodemappingisasfollows:0 Noerror1 Illegalfunction2 Illegaldataaddress3 Illegaldatavalue4 Failureinassociateddevice5 Acknowledge6 Busy,rejectedmessage7 NAK—NegativeacknowledgeFormoreinformationabouttheseerrorcodes,refertoyourdevice'sdocumentation.erroroutcontainserrorinformation.IferrorinindicatesthatanerroroccurredbeforethisVIorfunctionran,erroroutcontainsthesameerrorinformation.Otherwise,itdescribestheerrorstatusthatthisVIorfunctionproduces.Right-clicktheerroroutfrontpanelindicatorandselectExplainErrorfromtheshortcutmenuformoreinformationabouttheerror.
statusisTRUE(X)ifanerroroccurredorFALSE(checkmark)toindicateawarningorthatnoerroroccurred.codeistheerrororwarningcode.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourcedescribestheoriginoftheerrororwarningandis,inmostcases,thenameoftheVIorfunctionthatproducedtheerrororwarning.
MBEthernetMasterQueryWriteMultipleRegisters(poly).viThemasterusesthisVItowritemultipleregisterstotheslave.Thiscorrespondstoapublicfunctioncodeof16intheMODBUSprotocol.
MBAPHeaderisaclustercontainingthetransactionIDandUnitID.ThisisadditionalinformationnotusuallyrequiredforaMODBUStransaction.
TransactionIdentifier—Thisidentifierisfortransactionpairing;theMODBUSservercopiestherequesttransactionidentifierintheresponse.UnitIdentifier—Thisfieldisforintra-systemroutingpurposes.IttypicallycommunicatestoaMODBUSseriallineslavethroughagatewaybetweenanEthernetTCP-IPnetworkandaMODBUSserialline.TheMODBUSclientsetsthisfieldintherequest,andtheserverresponsemustreturnthisfieldwiththesamevalue.
TCPConnectionRefnuminisanetworkconnectionrefnumthatuniquelyidentifiestheTCPconnection.UseTCPOpenConnection.vitoopenaTCPconnection.StartingAddressistheaddresslocationofthefirstregistertowrite.Thisaddressissometimesreferredtoasoffset.Refertoyourdevice'sdocumentationtofindtheregisteraddressmapping.
BesuretospecifythecorrectaddressintheMODBUSdeviceconfigurationsoftwarefortheregisteryouwanttouseinLabVIEW.InmostMODBUSdeviceconfigurationsoftware,youmustenteranamefortheregisteryouwanttouse.PerMODBUSconvention,theregisteraddressoftheslavedeviceiscalculatedbysubtracting1fromtheregisternamethatyouspecifyinthemasterdeviceconfigurationsoftware.TheMODBUSLabVIEWlibraryexpectsregisteraddresses,notregisternames,soyoumayneed
tosubtract1fromtheaddressyoudefinedintheMODBUSdeviceconfigurationsoftware.Forexample,aregisternamedefinedas2inaMODBUSconfigurationdevicetranslatestoregisteraddress1intheHoldingRegisterstableoftheLabVIEWMODBUSlibrary,asshownbelow.MODBUSDevice
HoldingRegisterName=2
LabVIEW HoldingRegisterAddress=1
Registersaretheregisterstowrite.Thearraylengthrepresentshowmanyregisterswillbewritten.Timeoutspecifiesthemaximumtimeperiod,inmilliseconds,thattheVIwaitsfortheslave'sresponsebeforethrowinganerror.errorindescribeserrorconditionsthatoccurbeforethisVIorfunctionruns.Thedefaultisnoerror.IfanerroroccurredbeforethisVIorfunctionruns,theVIorfunctionpassestheerrorinvaluetoerrorout.IfanerroroccurswhilethisVIorfunctionruns,theVIorfunctionrunsnormallyandsetsitsownerrorstatusinerrorout.UsetheSimpleErrorHandlerorGeneralErrorHandlerVIstodisplaythedescriptionoftheerrorcode.Useerrorinanderrorouttocheckerrorsandtospecifyexecutionorderbywiringerroroutfromonenodetoerrorinofthenextnode.
statusisTRUE(X)ifanerroroccurredbeforethisVIorfunctionranorFALSE(checkmark)toindicateawarningorthatnoerroroccurredbeforethisVIorfunctionran.ThedefaultisFALSE.codeistheerrororwarningcode.Thedefaultis0.IfstatusisTRUE,codeisanegativeerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourceidentifieswhereanerroroccurred.ThesourcestringincludesthenameoftheVIthatproducedtheerror,whatinputsareinerror,andhowtoeliminatetheerror.
TCPConnectionRefnum(dup)canbeaninputtoanotherMODBUSVI,oryoucancloseitusingTCPCloseConnection.vi.
ExceptionCodeisnonzeroifaMODBUSerrorhasoccurred.The
exceptioncodemappingisasfollows:0 Noerror1 Illegalfunction2 Illegaldataaddress3 Illegaldatavalue4 Failureinassociateddevice5 Acknowledge6 Busy,rejectedmessage7 NAK—NegativeacknowledgeFormoreinformationabouttheseerrorcodes,refertoyourdevice'sdocumentation.erroroutcontainserrorinformation.IferrorinindicatesthatanerroroccurredbeforethisVIorfunctionran,erroroutcontainsthesameerrorinformation.Otherwise,itdescribestheerrorstatusthatthisVIorfunctionproduces.Right-clicktheerroroutfrontpanelindicatorandselectExplainErrorfromtheshortcutmenuformoreinformationabouttheerror.
statusisTRUE(X)ifanerroroccurredorFALSE(checkmark)toindicateawarningorthatnoerroroccurred.codeistheerrororwarningcode.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourcedescribestheoriginoftheerrororwarningandis,inmostcases,thenameoftheVIorfunctionthatproducedtheerrororwarning.
MBEthernetMasterQueryWriteSingleCoil(poly).viThemasterusesthisVItowriteasinglecoiltotheslave.Thiscorrespondstoapublicfunctioncodeof5intheMODBUSprotocol.
MBAPHeaderisaclustercontainingthetransactionIDandUnitID.ThisisadditionalinformationnotusuallyrequiredforaMODBUStransaction.
TransactionIdentifier—Thisidentifierisfortransactionpairing;theMODBUSservercopiestherequesttransactionidentifierintheresponse.UnitIdentifier—Thisfieldisforintra-systemroutingpurposes.IttypicallycommunicatestoaMODBUSseriallineslavethroughagatewaybetweenanEthernetTCP-IPnetworkandaMODBUSserialline.TheMODBUSclientsetsthisfieldintherequest,andtheserverresponsemustreturnthisfieldwiththesamevalue.
TCPConnectionRefnuminisanetworkconnectionrefnumthatuniquelyidentifiestheTCPconnection.UseTCPOpenConnection.vitoopenaTCPconnection.Addressisthefirstaddresslocationofthecoiltowrite.Thisaddressissometimesreferredtoasoffset.Refertoyourdevice'sdocumentationtofindthecoiladdressmapping.
BesuretospecifythecorrectaddressintheMODBUSdeviceconfigurationsoftwarefortheregisteryouwanttouseinLabVIEW.InmostMODBUSdeviceconfigurationsoftware,youmustenteranamefortheregisteryouwanttouse.PerMODBUSconvention,theregisteraddressoftheslavedeviceiscalculatedbysubtracting1fromtheregisternamethatyouspecifyinthemasterdeviceconfigurationsoftware.TheMODBUSLabVIEWlibraryexpectsregisteraddresses,notregisternames,soyoumayneed
tosubtract1fromtheaddressyoudefinedintheMODBUSdeviceconfigurationsoftware.Forexample,aregisternamedefinedas2inaMODBUSconfigurationdevicetranslatestoregisteraddress1intheHoldingRegisterstableoftheLabVIEWMODBUSlibrary,asshownbelow.MODBUSDevice
HoldingRegisterName=2
LabVIEW HoldingRegisterAddress=1
Coilisthecoiltowrite.Timeoutspecifiesthemaximumtimeperiod,inmilliseconds,thattheVIwaitsfortheslave'sresponsebeforethrowinganerror.errorindescribeserrorconditionsthatoccurbeforethisVIorfunctionruns.Thedefaultisnoerror.IfanerroroccurredbeforethisVIorfunctionruns,theVIorfunctionpassestheerrorinvaluetoerrorout.IfanerroroccurswhilethisVIorfunctionruns,theVIorfunctionrunsnormallyandsetsitsownerrorstatusinerrorout.UsetheSimpleErrorHandlerorGeneralErrorHandlerVIstodisplaythedescriptionoftheerrorcode.Useerrorinanderrorouttocheckerrorsandtospecifyexecutionorderbywiringerroroutfromonenodetoerrorinofthenextnode.
statusisTRUE(X)ifanerroroccurredbeforethisVIorfunctionranorFALSE(checkmark)toindicateawarningorthatnoerroroccurredbeforethisVIorfunctionran.ThedefaultisFALSE.codeistheerrororwarningcode.Thedefaultis0.IfstatusisTRUE,codeisanegativeerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourceidentifieswhereanerroroccurred.ThesourcestringincludesthenameoftheVIthatproducedtheerror,whatinputsareinerror,andhowtoeliminatetheerror.
TCPConnectionRefnum(dup)canbeaninputtoanotherMODBUSVI,oryoucancloseitusingTCPCloseConnection.vi.ExceptionCodeisnonzeroifaMODBUSerrorhasoccurred.Theexceptioncodemappingisasfollows:0 Noerror
1 Illegalfunction2 Illegaldataaddress3 Illegaldatavalue4 Failureinassociateddevice5 Acknowledge6 Busy,rejectedmessage7 NAK—NegativeacknowledgeFormoreinformationabouttheseerrorcodes,refertoyourdevice'sdocumentation.
erroroutcontainserrorinformation.IferrorinindicatesthatanerroroccurredbeforethisVIorfunctionran,erroroutcontainsthesameerrorinformation.Otherwise,itdescribestheerrorstatusthatthisVIorfunctionproduces.Right-clicktheerroroutfrontpanelindicatorandselectExplainErrorfromtheshortcutmenuformoreinformationabouttheerror.
statusisTRUE(X)ifanerroroccurredorFALSE(checkmark)toindicateawarningorthatnoerroroccurred.codeistheerrororwarningcode.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourcedescribestheoriginoftheerrororwarningandis,inmostcases,thenameoftheVIorfunctionthatproducedtheerrororwarning.
MBEthernetMasterQueryWriteSingleRegister(poly).viThemasterusesthisVItowriteasingleregistertotheslave.Thiscorrespondstoapublicfunctioncodeof6intheMODBUSprotocol.
MBAPHeaderisaclustercontainingthetransactionIDandUnitID.ThisisadditionalinformationnotusuallyrequiredforaMODBUStransaction.
TransactionIdentifier—Thisidentifierisfortransactionpairing;theMODBUSservercopiestherequesttransactionidentifierintheresponse.UnitIdentifier—Thisfieldisforintra-systemroutingpurposes.IttypicallycommunicatestoaMODBUSseriallineslavethroughagatewaybetweenanEthernetTCP-IPnetworkandaMODBUSserialline.TheMODBUSclientsetsthisfieldintherequest,andtheserverresponsemustreturnthisfieldwiththesamevalue.
TCPConnectionRefnuminisanetworkconnectionrefnumthatuniquelyidentifiestheTCPconnection.UseTCPOpenConnection.vitoopenaTCPconnection.Addressistheaddresslocationoftheregistertowrite.Thisaddressissometimesreferredtoasoffset.Refertoyourdevice'sdocumentationtofindtheregisteraddressmapping.
BesuretospecifythecorrectaddressintheMODBUSdeviceconfigurationsoftwarefortheregisteryouwanttouseinLabVIEW.InmostMODBUSdeviceconfigurationsoftware,youmustenteranamefortheregisteryouwanttouse.PerMODBUSconvention,theregisteraddressoftheslavedeviceiscalculatedbysubtracting1fromtheregisternamethatyouspecifyinthemasterdeviceconfigurationsoftware.TheMODBUSLabVIEWlibraryexpectsregisteraddresses,notregisternames,soyoumayneed
tosubtract1fromtheaddressyoudefinedintheMODBUSdeviceconfigurationsoftware.Forexample,aregisternamedefinedas2inaMODBUSconfigurationdevicetranslatestoregisteraddress1intheHoldingRegisterstableoftheLabVIEWMODBUSlibrary,asshownbelow.MODBUSDevice
HoldingRegisterName=2
LabVIEW HoldingRegisterAddress=1
Registeristheregistertowrite.Timeoutspecifiesthemaximumtimeperiod,inmilliseconds,thattheVIwaitsfortheslave'sresponsebeforethrowinganerror.errorindescribeserrorconditionsthatoccurbeforethisVIorfunctionruns.Thedefaultisnoerror.IfanerroroccurredbeforethisVIorfunctionruns,theVIorfunctionpassestheerrorinvaluetoerrorout.IfanerroroccurswhilethisVIorfunctionruns,theVIorfunctionrunsnormallyandsetsitsownerrorstatusinerrorout.UsetheSimpleErrorHandlerorGeneralErrorHandlerVIstodisplaythedescriptionoftheerrorcode.Useerrorinanderrorouttocheckerrorsandtospecifyexecutionorderbywiringerroroutfromonenodetoerrorinofthenextnode.
statusisTRUE(X)ifanerroroccurredbeforethisVIorfunctionranorFALSE(checkmark)toindicateawarningorthatnoerroroccurredbeforethisVIorfunctionran.ThedefaultisFALSE.codeistheerrororwarningcode.Thedefaultis0.IfstatusisTRUE,codeisanegativeerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourceidentifieswhereanerroroccurred.ThesourcestringincludesthenameoftheVIthatproducedtheerror,whatinputsareinerror,andhowtoeliminatetheerror.
TCPConnectionRefnum(dup)canbeaninputtoanotherMODBUSVI,oryoucancloseitusingTCPCloseConnection.vi.ExceptionCodeisnonzeroifaMODBUSerrorhasoccurred.Theexceptioncodemappingisasfollows:0 Noerror
1 Illegalfunction2 Illegaldataaddress3 Illegaldatavalue4 Failureinassociateddevice5 Acknowledge6 Busy,rejectedmessage7 NAK—NegativeacknowledgeFormoreinformationabouttheseerrorcodes,refertoyourdevice'sdocumentation.
erroroutcontainserrorinformation.IferrorinindicatesthatanerroroccurredbeforethisVIorfunctionran,erroroutcontainsthesameerrorinformation.Otherwise,itdescribestheerrorstatusthatthisVIorfunctionproduces.Right-clicktheerroroutfrontpanelindicatorandselectExplainErrorfromtheshortcutmenuformoreinformationabouttheerror.
statusisTRUE(X)ifanerroroccurredorFALSE(checkmark)toindicateawarningorthatnoerroroccurred.codeistheerrororwarningcode.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourcedescribestheoriginoftheerrororwarningandis,inmostcases,thenameoftheVIorfunctionthatproducedtheerrororwarning.
MBSerialMasterQueryReadCoils(poly).viThemasterusesthisVItoreadtheslaves'coils.Thiscorrespondstoapublicfunctioncodeof1intheMODBUSprotocol.
SerialParametersareparametersthatmodifythewaytheMODBUSframeisstructured.RefertotheMODBUSspecificationformoreinformationabouttheMODBUSFrame.TheSerialParametersinLabVIEWisaclustercontaininganenum(Mode)andaninteger(SlaveAddress).ModeRTUDataisrepresentedinbinaryformat.ASCIIDataisrepresentedinASCII,soitishumanreadable.
SlaveAddressThisistheaddressoftheslaveyouarecommunicatingwith.ThispropertyisusuallyvalidforRS-485networks,whichcanhavemultipleMODBUSdevicesconnectedtothesamenetwork.
Note:Consultyourdevicedocumentationtofindouthowtovalidate/changetheaddressofyourdevice.
VISAresourcenamespecifiestheresourcetobeopened.Thiscontrolalsospecifiesthesessionandclass.FormoreinformationaboutVISAresourcenames,refertotheNI-VISAHelp.StartingAddressisthefirstaddresslocationofthecoiltoread.Thisaddressissometimesreferredtoasoffset.Refertoyourdevice'sdocumentationtofindthecoiladdressmapping.
BesuretospecifythecorrectaddressintheMODBUSdeviceconfigurationsoftwarefortheregisteryouwanttouseinLabVIEW.InmostMODBUSdeviceconfigurationsoftware,youmustenteranamefortheregisteryouwanttouse.PerMODBUSconvention,
theregisteraddressoftheslavedeviceiscalculatedbysubtracting1fromtheregisternamethatyouspecifyinthemasterdeviceconfigurationsoftware.TheMODBUSLabVIEWlibraryexpectsregisteraddresses,notregisternames,soyoumayneedtosubtract1fromtheaddressyoudefinedintheMODBUSdeviceconfigurationsoftware.Forexample,aregisternamedefinedas2inaMODBUSconfigurationdevicetranslatestoregisteraddress1intheHoldingRegisterstableoftheLabVIEWMODBUSlibrary,asshownbelow.MODBUSDevice
HoldingRegisterName=2
LabVIEW HoldingRegisterAddress=1
Quantityrepresentshowmanycoilstoreadfromtheslave.TheVIreturnsthecoilatStartingAddressandeachfollowingcoiluptoQuantity.Forexample,ifStartingAddressis0andQuantityis4,theVIreadscoilsfromtheslaveataddress0,1,2,and3.Timeoutspecifiesthemaximumtimeperiod,inmilliseconds,thattheVIwaitsfortheslave'sresponsebeforethrowinganerror.errorindescribeserrorconditionsthatoccurbeforethisVIorfunctionruns.Thedefaultisnoerror.IfanerroroccurredbeforethisVIorfunctionruns,theVIorfunctionpassestheerrorinvaluetoerrorout.IfanerroroccurswhilethisVIorfunctionruns,theVIorfunctionrunsnormallyandsetsitsownerrorstatusinerrorout.UsetheSimpleErrorHandlerorGeneralErrorHandlerVIstodisplaythedescriptionoftheerrorcode.Useerrorinanderrorouttocheckerrorsandtospecifyexecutionorderbywiringerroroutfromonenodetoerrorinofthenextnode.
statusisTRUE(X)ifanerroroccurredbeforethisVIorfunctionranorFALSE(checkmark)toindicateawarningorthatnoerroroccurredbeforethisVIorfunctionran.ThedefaultisFALSE.codeistheerrororwarningcode.Thedefaultis0.IfstatusisTRUE,codeisanegativeerrorcode.IfstatusisFALSE,codeis0orawarningcode.
sourceidentifieswhereanerroroccurred.ThesourcestringincludesthenameoftheVIthatproducedtheerror,
whatinputsareinerror,andhowtoeliminatetheerror.
VISAresourcenameoutistheresourcetowhichaVISAsessionisopenedanditsclass.TheclassmatchesthatoftheVISAresourcenameinput.FormoreinformationaboutVISAresourcenames,refertotheNI-VISAHelp.Coilsrepresentsthedatareadfromtheslave.ExceptionCodeisnonzeroifaMODBUSerrorhasoccurred.Theexceptioncodemappingisasfollows:0 Noerror1 Illegalfunction2 Illegaldataaddress3 Illegaldatavalue4 Failureinassociateddevice5 Acknowledge6 Busy,rejectedmessage7 NAK—NegativeacknowledgeFormoreinformationabouttheseerrorcodes,refertoyourdevice'sdocumentation.erroroutcontainserrorinformation.IferrorinindicatesthatanerroroccurredbeforethisVIorfunctionran,erroroutcontainsthesameerrorinformation.Otherwise,itdescribestheerrorstatusthatthisVIorfunctionproduces.Right-clicktheerroroutfrontpanelindicatorandselectExplainErrorfromtheshortcutmenuformoreinformationabouttheerror.
statusisTRUE(X)ifanerroroccurredorFALSE(checkmark)toindicateawarningorthatnoerroroccurred.codeistheerrororwarningcode.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeis0orawarningcode.
sourcedescribestheoriginoftheerrororwarningandis,inmostcases,thenameoftheVIorfunctionthatproducedtheerrororwarning.
MBSerialMasterQueryReadDiscreteInputs(poly).viThemasterusesthisVItoreadtheslaves'discreteinputs.Thiscorrespondstoapublicfunctioncodeof2intheMODBUSprotocol.
SerialParametersareparametersthatmodifythewaytheMODBUSframeisstructured.RefertotheMODBUSspecificationformoreinformationabouttheMODBUSFrame.TheSerialParametersinLabVIEWisaclustercontaininganenum(Mode)andaninteger(SlaveAddress).ModeRTUDataisrepresentedinbinaryformat.ASCIIDataisrepresentedinASCII,soitishumanreadable.
SlaveAddressThisistheaddressoftheslaveyouarecommunicatingwith.ThispropertyisusuallyvalidforRS-485networks,whichcanhavemultipleMODBUSdevicesconnectedtothesamenetwork.
Note:Consultyourdevicedocumentationtofindouthowtovalidate/changetheaddressofyourdevice.
VISAresourcenamespecifiestheresourcetobeopened.Thiscontrolalsospecifiesthesessionandclass.FormoreinformationaboutVISAresourcenames,refertotheNI-VISAHelp.StartingAddressisthefirstaddresslocationofthediscreteinputstoread.Thisaddressissometimesreferredtoasoffset.Refertoyourdevice'sdocumentationtofindthediscreteinputaddressmapping.
BesuretospecifythecorrectaddressintheMODBUSdeviceconfigurationsoftwarefortheregisteryouwanttouseinLabVIEW.
InmostMODBUSdeviceconfigurationsoftware,youmustenteranamefortheregisteryouwanttouse.PerMODBUSconvention,theregisteraddressoftheslavedeviceiscalculatedbysubtracting1fromtheregisternamethatyouspecifyinthemasterdeviceconfigurationsoftware.TheMODBUSLabVIEWlibraryexpectsregisteraddresses,notregisternames,soyoumayneedtosubtract1fromtheaddressyoudefinedintheMODBUSdeviceconfigurationsoftware.Forexample,aregisternamedefinedas2inaMODBUSconfigurationdevicetranslatestoregisteraddress1intheHoldingRegisterstableoftheLabVIEWMODBUSlibrary,asshownbelow.MODBUSDevice
HoldingRegisterName=2
LabVIEW HoldingRegisterAddress=1
Quantityrepresentshowmanydiscreteinputstoreadfromtheslave.TheVIreturnsthediscreteinputatStartingAddressandeachfollowingdiscreteinputuptoQuantity.Forexample,ifStartingAddressis0andQuantityis4,theVIreadsdiscreteinputsfromtheslaveataddress0,1,2,and3.Timeoutspecifiesthemaximumtimeperiod,inmilliseconds,thattheVIwaitsfortheslave'sresponsebeforethrowinganerror.errorindescribeserrorconditionsthatoccurbeforethisVIorfunctionruns.Thedefaultisnoerror.IfanerroroccurredbeforethisVIorfunctionruns,theVIorfunctionpassestheerrorinvaluetoerrorout.IfanerroroccurswhilethisVIorfunctionruns,theVIorfunctionrunsnormallyandsetsitsownerrorstatusinerrorout.UsetheSimpleErrorHandlerorGeneralErrorHandlerVIstodisplaythedescriptionoftheerrorcode.Useerrorinanderrorouttocheckerrorsandtospecifyexecutionorderbywiringerroroutfromonenodetoerrorinofthenextnode.
statusisTRUE(X)ifanerroroccurredbeforethisVIorfunctionranorFALSE(checkmark)toindicateawarningorthatnoerroroccurredbeforethisVIorfunctionran.ThedefaultisFALSE.codeistheerrororwarningcode.Thedefaultis0.IfstatusisTRUE,codeisanegativeerrorcode.IfstatusisFALSE,
codeis0orawarningcode.sourceidentifieswhereanerroroccurred.ThesourcestringincludesthenameoftheVIthatproducedtheerror,whatinputsareinerror,andhowtoeliminatetheerror.
VISAresourcenameoutistheresourcetowhichaVISAsessionisopenedanditsclass.TheclassmatchesthatoftheVISAresourcenameinput.FormoreinformationaboutVISAresourcenames,refertotheNI-VISAHelp.DiscreteInputsrepresentsthedatareadfromtheslave.ExceptionCodeisnonzeroifaMODBUSerrorhasoccurred.Theexceptioncodemappingisasfollows:0 Noerror1 Illegalfunction2 Illegaldataaddress3 Illegaldatavalue4 Failureinassociateddevice5 Acknowledge6 Busy,rejectedmessage7 NAK—NegativeacknowledgeFormoreinformationabouttheseerrorcodes,refertoyourdevice'sdocumentation.erroroutcontainserrorinformation.IferrorinindicatesthatanerroroccurredbeforethisVIorfunctionran,erroroutcontainsthesameerrorinformation.Otherwise,itdescribestheerrorstatusthatthisVIorfunctionproduces.Right-clicktheerroroutfrontpanelindicatorandselectExplainErrorfromtheshortcutmenuformoreinformationabouttheerror.
statusisTRUE(X)ifanerroroccurredorFALSE(checkmark)toindicateawarningorthatnoerroroccurred.codeistheerrororwarningcode.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeis0orawarningcode.
sourcedescribestheoriginoftheerrororwarningandis,inmostcases,thenameoftheVIorfunctionthatproducedtheerrororwarning.
MBSerialMasterQueryReadExceptionStatus(poly).viThemasterusesthisVItoreadtheexceptionstatusfromtheslave.Thiscorrespondstoapublicfunctioncodeof7intheMODBUSprotocol.
VISAresourcenamespecifiestheresourcetobeopened.Thiscontrolalsospecifiesthesessionandclass.FormoreinformationaboutVISAresourcenames,refertotheNI-VISAHelp.Timeoutspecifiesthemaximumtimeperiod,inmilliseconds,thattheVIwaitsfortheslave'sresponsebeforethrowinganerror.errorindescribeserrorconditionsthatoccurbeforethisVIorfunctionruns.Thedefaultisnoerror.IfanerroroccurredbeforethisVIorfunctionruns,theVIorfunctionpassestheerrorinvaluetoerrorout.IfanerroroccurswhilethisVIorfunctionruns,theVIorfunctionrunsnormallyandsetsitsownerrorstatusinerrorout.UsetheSimpleErrorHandlerorGeneralErrorHandlerVIstodisplaythedescriptionoftheerrorcode.Useerrorinanderrorouttocheckerrorsandtospecifyexecutionorderbywiringerroroutfromonenodetoerrorinofthenextnode.
statusisTRUE(X)ifanerroroccurredbeforethisVIorfunctionranorFALSE(checkmark)toindicateawarningorthatnoerroroccurredbeforethisVIorfunctionran.ThedefaultisFALSE.codeistheerrororwarningcode.Thedefaultis0.IfstatusisTRUE,codeisanegativeerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourceidentifieswhereanerroroccurred.ThesourcestringincludesthenameoftheVIthatproducedtheerror,whatinputsareinerror,andhowtoeliminatetheerror.
SerialParametersareparametersthatmodifythewaytheMODBUSframeisstructured.RefertotheMODBUSspecificationformoreinformationabouttheMODBUSFrame.TheSerial
ParametersinLabVIEWisaclustercontaininganenum(Mode)andaninteger(SlaveAddress).ModeRTUDataisrepresentedinbinaryformat.ASCIIDataisrepresentedinASCII,soitishumanreadable.
SlaveAddressThisistheaddressoftheslaveyouarecommunicatingwith.ThispropertyisusuallyvalidforRS-485networks,whichcanhavemultipleMODBUSdevicesconnectedtothesamenetwork.
Note:Consultyourdevicedocumentationtofindouthowtovalidate/changetheaddressofyourdevice.
VISAresourcenameoutistheresourcetowhichaVISAsessionisopenedanditsclass.TheclassmatchesthatoftheVISAresourcenameinput.FormoreinformationaboutVISAresourcenames,refertotheNI-VISAHelp.ExceptionCodeisnonzeroifaMODBUSerrorhasoccurred.Theexceptioncodemappingisasfollows:0 Noerror1 Illegalfunction2 Illegaldataaddress3 Illegaldatavalue4 Failureinassociateddevice5 Acknowledge6 Busy,rejectedmessage7 NAK—NegativeacknowledgeFormoreinformationabouttheseerrorcodes,refertoyourdevice'sdocumentation.erroroutcontainserrorinformation.IferrorinindicatesthatanerroroccurredbeforethisVIorfunctionran,erroroutcontainsthesameerrorinformation.Otherwise,itdescribestheerrorstatusthatthisVIorfunctionproduces.Right-clicktheerroroutfront
panelindicatorandselectExplainErrorfromtheshortcutmenuformoreinformationabouttheerror.
statusisTRUE(X)ifanerroroccurredorFALSE(checkmark)toindicateawarningorthatnoerroroccurred.codeistheerrororwarningcode.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourcedescribestheoriginoftheerrororwarningandis,inmostcases,thenameoftheVIorfunctionthatproducedtheerrororwarning.
MBSerialMasterQueryReadHoldingRegisters(poly).viThemasterusesthisVItoreadtheslaves'holdingregisters.Thiscorrespondstoapublicfunctioncodeof3intheMODBUSprotocol.
SerialParametersareparametersthatmodifythewaytheMODBUSframeisstructured.RefertotheMODBUSspecificationformoreinformationabouttheMODBUSFrame.TheSerialParametersinLabVIEWisaclustercontaininganenum(Mode)andaninteger(SlaveAddress).ModeRTUDataisrepresentedinbinaryformat.ASCIIDataisrepresentedinASCII,soitishumanreadable.
SlaveAddressThisistheaddressoftheslaveyouarecommunicatingwith.ThispropertyisusuallyvalidforRS-485networks,whichcanhavemultipleMODBUSdevicesconnectedtothesamenetwork.
Note:Consultyourdevicedocumentationtofindouthowtovalidate/changetheaddressofyourdevice.
VISAresourcenamespecifiestheresourcetobeopened.Thiscontrolalsospecifiesthesessionandclass.FormoreinformationaboutVISAresourcenames,refertotheNI-VISAHelp.StartingAddressisthefirstaddresslocationoftheholdingregistertoread.Thisaddressissometimesreferredtoasoffset.Refertoyourdevice'sdocumentationtofindtheholdingregisteraddressmapping.
BesuretospecifythecorrectaddressintheMODBUSdeviceconfigurationsoftwarefortheregisteryouwanttouseinLabVIEW.
InmostMODBUSdeviceconfigurationsoftware,youmustenteranamefortheregisteryouwanttouse.PerMODBUSconvention,theregisteraddressoftheslavedeviceiscalculatedbysubtracting1fromtheregisternamethatyouspecifyinthemasterdeviceconfigurationsoftware.TheMODBUSLabVIEWlibraryexpectsregisteraddresses,notregisternames,soyoumayneedtosubtract1fromtheaddressyoudefinedintheMODBUSdeviceconfigurationsoftware.Forexample,aregisternamedefinedas2inaMODBUSconfigurationdevicetranslatestoregisteraddress1intheHoldingRegisterstableoftheLabVIEWMODBUSlibrary,asshownbelow.MODBUSDevice
HoldingRegisterName=2
LabVIEW HoldingRegisterAddress=1
Quantityrepresentshowmanyholdingregisterstoreadfromtheslave.TheVIreturnstheholdingregisteratStartingAddressandeachfollowingholdingregisteruptoQuantity.Forexample,ifStartingAddressis0andQuantityis4,theVIreadsholdingregistersfromtheslaveataddress0,1,2,and3.Timeoutspecifiesthemaximumtimeperiod,inmilliseconds,thattheVIwaitsfortheslave'sresponsebeforethrowinganerror.errorindescribeserrorconditionsthatoccurbeforethisVIorfunctionruns.Thedefaultisnoerror.IfanerroroccurredbeforethisVIorfunctionruns,theVIorfunctionpassestheerrorinvaluetoerrorout.IfanerroroccurswhilethisVIorfunctionruns,theVIorfunctionrunsnormallyandsetsitsownerrorstatusinerrorout.UsetheSimpleErrorHandlerorGeneralErrorHandlerVIstodisplaythedescriptionoftheerrorcode.Useerrorinanderrorouttocheckerrorsandtospecifyexecutionorderbywiringerroroutfromonenodetoerrorinofthenextnode.
statusisTRUE(X)ifanerroroccurredbeforethisVIorfunctionranorFALSE(checkmark)toindicateawarningorthatnoerroroccurredbeforethisVIorfunctionran.ThedefaultisFALSE.codeistheerrororwarningcode.Thedefaultis0.IfstatusisTRUE,codeisanegativeerrorcode.IfstatusisFALSE,
codeis0orawarningcode.sourceidentifieswhereanerroroccurred.ThesourcestringincludesthenameoftheVIthatproducedtheerror,whatinputsareinerror,andhowtoeliminatetheerror.
VISAresourcenameoutistheresourcetowhichaVISAsessionisopenedanditsclass.TheclassmatchesthatoftheVISAresourcenameinput.FormoreinformationaboutVISAresourcenames,refertotheNI-VISAHelp.HoldingRegistersrepresentsthedatareadfromtheslave(arrayofU16).ExceptionCodeisnonzeroifaMODBUSerrorhasoccurred.Theexceptioncodemappingisasfollows:0 Noerror1 Illegalfunction2 Illegaldataaddress3 Illegaldatavalue4 Failureinassociateddevice5 Acknowledge6 Busy,rejectedmessage7 NAK—NegativeacknowledgeFormoreinformationabouttheseerrorcodes,refertoyourdevice'sdocumentation.erroroutcontainserrorinformation.IferrorinindicatesthatanerroroccurredbeforethisVIorfunctionran,erroroutcontainsthesameerrorinformation.Otherwise,itdescribestheerrorstatusthatthisVIorfunctionproduces.Right-clicktheerroroutfrontpanelindicatorandselectExplainErrorfromtheshortcutmenuformoreinformationabouttheerror.
statusisTRUE(X)ifanerroroccurredorFALSE(checkmark)toindicateawarningorthatnoerroroccurred.codeistheerrororwarningcode.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeis0orawarningcode.
sourcedescribestheoriginoftheerrororwarningandis,inmostcases,thenameoftheVIorfunctionthatproducedtheerrororwarning.
MBSerialMasterQueryReadInputRegisters(poly).viThemasterusesthisVItoreadtheslavesinputregisters.Thiscorrespondstoapublicfunctioncodeof4intheMODBUSprotocol.
SerialParametersareparametersthatmodifythewaytheMODBUSframeisstructured.RefertotheMODBUSspecificationformoreinformationabouttheMODBUSFrame.TheSerialParametersinLabVIEWisaclustercontaininganenum(Mode)andaninteger(SlaveAddress).ModeRTUDataisrepresentedinbinaryformat.ASCIIDataisrepresentedinASCII,soitishumanreadable.
SlaveAddressThisistheaddressoftheslaveyouarecommunicatingwith.ThispropertyisusuallyvalidforRS-485networks,whichcanhavemultipleMODBUSdevicesconnectedtothesamenetwork.
Note:Consultyourdevicedocumentationtofindouthowtovalidate/changetheaddressofyourdevice.
VISAresourcenamespecifiestheresourcetobeopened.Thiscontrolalsospecifiesthesessionandclass.FormoreinformationaboutVISAresourcenames,refertotheNI-VISAHelp.StartingAddressisthefirstaddresslocationoftheinputregistertoread.Thisaddressissometimesreferredtoasoffset.Refertoyourdevice'sdocumentationtofindtheinputregisteraddressmapping.
BesuretospecifythecorrectaddressintheMODBUSdeviceconfigurationsoftwarefortheregisteryouwanttouseinLabVIEW.
InmostMODBUSdeviceconfigurationsoftware,youmustenteranamefortheregisteryouwanttouse.PerMODBUSconvention,theregisteraddressoftheslavedeviceiscalculatedbysubtracting1fromtheregisternamethatyouspecifyinthemasterdeviceconfigurationsoftware.TheMODBUSLabVIEWlibraryexpectsregisteraddresses,notregisternames,soyoumayneedtosubtract1fromtheaddressyoudefinedintheMODBUSdeviceconfigurationsoftware.Forexample,aregisternamedefinedas2inaMODBUSconfigurationdevicetranslatestoregisteraddress1intheHoldingRegisterstableoftheLabVIEWMODBUSlibrary,asshownbelow.MODBUSDevice
HoldingRegisterName=2
LabVIEW HoldingRegisterAddress=1
Quantityrepresentshowmanyinputregisterstoreadfromtheslave.TheVIreturnstheinputregisteratStartingAddressandeachfollowinginputregisteruptoQuantity.Forexample,ifStartingAddressis0andQuantityis4,theVIreadsinputregistersfromtheslaveataddress0,1,2,and3.Timeoutspecifiesthemaximumtimeperiod,inmilliseconds,thattheVIwaitsfortheslave'sresponsebeforethrowinganerror.errorindescribeserrorconditionsthatoccurbeforethisVIorfunctionruns.Thedefaultisnoerror.IfanerroroccurredbeforethisVIorfunctionruns,theVIorfunctionpassestheerrorinvaluetoerrorout.IfanerroroccurswhilethisVIorfunctionruns,theVIorfunctionrunsnormallyandsetsitsownerrorstatusinerrorout.UsetheSimpleErrorHandlerorGeneralErrorHandlerVIstodisplaythedescriptionoftheerrorcode.Useerrorinanderrorouttocheckerrorsandtospecifyexecutionorderbywiringerroroutfromonenodetoerrorinofthenextnode.
statusisTRUE(X)ifanerroroccurredbeforethisVIorfunctionranorFALSE(checkmark)toindicateawarningorthatnoerroroccurredbeforethisVIorfunctionran.ThedefaultisFALSE.codeistheerrororwarningcode.Thedefaultis0.IfstatusisTRUE,codeisanegativeerrorcode.IfstatusisFALSE,
codeis0orawarningcode.sourceidentifieswhereanerroroccurred.ThesourcestringincludesthenameoftheVIthatproducedtheerror,whatinputsareinerror,andhowtoeliminatetheerror.
VISAresourcenameoutistheresourcetowhichaVISAsessionisopenedanditsclass.TheclassmatchesthatoftheVISAresourcenameinput.FormoreinformationaboutVISAresourcenames,refertotheNI-VISAHelp.InputRegistersrepresentsthedatareadfromtheslave(arrayofU16).ExceptionCodeisnonzeroifaMODBUSerrorhasoccurred.Theexceptioncodemappingisasfollows:0 Noerror1 Illegalfunction2 Illegaldataaddress3 Illegaldatavalue4 Failureinassociateddevice5 Acknowledge6 Busy,rejectedmessage7 NAK—NegativeacknowledgeFormoreinformationabouttheseerrorcodes,refertoyourdevice'sdocumentation.erroroutcontainserrorinformation.IferrorinindicatesthatanerroroccurredbeforethisVIorfunctionran,erroroutcontainsthesameerrorinformation.Otherwise,itdescribestheerrorstatusthatthisVIorfunctionproduces.Right-clicktheerroroutfrontpanelindicatorandselectExplainErrorfromtheshortcutmenuformoreinformationabouttheerror.
statusisTRUE(X)ifanerroroccurredorFALSE(checkmark)toindicateawarningorthatnoerroroccurred.codeistheerrororwarningcode.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeis0orawarningcode.
sourcedescribestheoriginoftheerrororwarningandis,inmostcases,thenameoftheVIorfunctionthatproducedtheerrororwarning.
MBSerialMasterQueryWriteMultipleCoils(poly).viThemasterusesthisVItowritemultiplecoilstotheslave.Thiscorrespondstoapublicfunctioncodeof15intheMODBUSprotocol.
SerialParametersareparametersthatmodifythewaytheMODBUSframeisstructured.RefertotheMODBUSspecificationformoreinformationabouttheMODBUSFrame.TheSerialParametersinLabVIEWisaclustercontaininganenum(Mode)andaninteger(SlaveAddress).ModeRTUDataisrepresentedinbinaryformat.ASCIIDataisrepresentedinASCII,soitishumanreadable.
SlaveAddressThisistheaddressoftheslaveyouarecommunicatingwith.ThispropertyisusuallyvalidforRS-485networks,whichcanhavemultipleMODBUSdevicesconnectedtothesamenetwork.
Note:Consultyourdevicedocumentationtofindouthowtovalidate/changetheaddressofyourdevice.
VISAresourcenamespecifiestheresourcetobeopened.Thiscontrolalsospecifiesthesessionandclass.FormoreinformationaboutVISAresourcenames,refertotheNI-VISAHelp.StartingAddressistheaddresslocationofthefirstcoiltowrite.Thisaddressissometimesreferredtoasoffset.Refertoyourdevice'sdocumentationtofindthecoiladdressmapping.
BesuretospecifythecorrectaddressintheMODBUSdeviceconfigurationsoftwarefortheregisteryouwanttouseinLabVIEW.InmostMODBUSdeviceconfigurationsoftware,youmustentera
namefortheregisteryouwanttouse.PerMODBUSconvention,theregisteraddressoftheslavedeviceiscalculatedbysubtracting1fromtheregisternamethatyouspecifyinthemasterdeviceconfigurationsoftware.TheMODBUSLabVIEWlibraryexpectsregisteraddresses,notregisternames,soyoumayneedtosubtract1fromtheaddressyoudefinedintheMODBUSdeviceconfigurationsoftware.Forexample,aregisternamedefinedas2inaMODBUSconfigurationdevicetranslatestoregisteraddress1intheHoldingRegisterstableoftheLabVIEWMODBUSlibrary,asshownbelow.MODBUSDevice
HoldingRegisterName=2
LabVIEW HoldingRegisterAddress=1
Coilsisthecoilstowrite.Thearraylengthrepresentsthenumberofcoilsthatwillbewritten.Timeoutspecifiesthemaximumtimeperiod,inmilliseconds,thattheVIwaitsfortheslave'sresponsebeforethrowinganerror.errorindescribeserrorconditionsthatoccurbeforethisVIorfunctionruns.Thedefaultisnoerror.IfanerroroccurredbeforethisVIorfunctionruns,theVIorfunctionpassestheerrorinvaluetoerrorout.IfanerroroccurswhilethisVIorfunctionruns,theVIorfunctionrunsnormallyandsetsitsownerrorstatusinerrorout.UsetheSimpleErrorHandlerorGeneralErrorHandlerVIstodisplaythedescriptionoftheerrorcode.Useerrorinanderrorouttocheckerrorsandtospecifyexecutionorderbywiringerroroutfromonenodetoerrorinofthenextnode.
statusisTRUE(X)ifanerroroccurredbeforethisVIorfunctionranorFALSE(checkmark)toindicateawarningorthatnoerroroccurredbeforethisVIorfunctionran.ThedefaultisFALSE.codeistheerrororwarningcode.Thedefaultis0.IfstatusisTRUE,codeisanegativeerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourceidentifieswhereanerroroccurred.ThesourcestringincludesthenameoftheVIthatproducedtheerror,whatinputsareinerror,andhowtoeliminatetheerror.
VISAresourcenameoutistheresourcetowhichaVISAsessionisopenedanditsclass.TheclassmatchesthatoftheVISAresourcenameinput.FormoreinformationaboutVISAresourcenames,refertotheNI-VISAHelp.ExceptionCodeisnonzeroifaMODBUSerrorhasoccurred.Theexceptioncodemappingisasfollows:0 Noerror1 Illegalfunction2 Illegaldataaddress3 Illegaldatavalue4 Failureinassociateddevice5 Acknowledge6 Busy,rejectedmessage7 NAK—NegativeacknowledgeFormoreinformationabouttheseerrorcodes,refertoyourdevice'sdocumentation.erroroutcontainserrorinformation.IferrorinindicatesthatanerroroccurredbeforethisVIorfunctionran,erroroutcontainsthesameerrorinformation.Otherwise,itdescribestheerrorstatusthatthisVIorfunctionproduces.Right-clicktheerroroutfrontpanelindicatorandselectExplainErrorfromtheshortcutmenuformoreinformationabouttheerror.
statusisTRUE(X)ifanerroroccurredorFALSE(checkmark)toindicateawarningorthatnoerroroccurred.codeistheerrororwarningcode.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourcedescribestheoriginoftheerrororwarningandis,inmostcases,thenameoftheVIorfunctionthatproducedtheerrororwarning.
MBSerialMasterQueryWriteMultipleRegisters(poly).viThemasterusesthisVItowritemultipleregisterstotheslave.Thiscorrespondstoapublicfunctioncodeof16intheMODBUSprotocol.
SerialParametersareparametersthatmodifythewaytheMODBUSframeisstructured.RefertotheMODBUSspecificationformoreinformationabouttheMODBUSFrame.TheSerialParametersinLabVIEWisaclustercontaininganenum(Mode)andaninteger(SlaveAddress).ModeRTUDataisrepresentedinbinaryformat.ASCIIDataisrepresentedinASCII,soitishumanreadable.
SlaveAddressThisistheaddressoftheslaveyouarecommunicatingwith.ThispropertyisusuallyvalidforRS-485networks,whichcanhavemultipleMODBUSdevicesconnectedtothesamenetwork.
Note:Consultyourdevicedocumentationtofindouthowtovalidate/changetheaddressofyourdevice.
VISAresourcenamespecifiestheresourcetobeopened.Thiscontrolalsospecifiesthesessionandclass.FormoreinformationaboutVISAresourcenames,refertotheNI-VISAHelp.StartingAddressistheaddresslocationofthefirstregistertowrite.Thisaddressissometimesreferredtoasoffset.Refertoyourdevice'sdocumentationtofindtheregisteraddressmapping.
BesuretospecifythecorrectaddressintheMODBUSdeviceconfigurationsoftwarefortheregisteryouwanttouseinLabVIEW.InmostMODBUSdeviceconfigurationsoftware,youmustentera
namefortheregisteryouwanttouse.PerMODBUSconvention,theregisteraddressoftheslavedeviceiscalculatedbysubtracting1fromtheregisternamethatyouspecifyinthemasterdeviceconfigurationsoftware.TheMODBUSLabVIEWlibraryexpectsregisteraddresses,notregisternames,soyoumayneedtosubtract1fromtheaddressyoudefinedintheMODBUSdeviceconfigurationsoftware.Forexample,aregisternamedefinedas2inaMODBUSconfigurationdevicetranslatestoregisteraddress1intheHoldingRegisterstableoftheLabVIEWMODBUSlibrary,asshownbelow.MODBUSDevice
HoldingRegisterName=2
LabVIEW HoldingRegisterAddress=1
Registersaretheregisterstowrite.Thearraylengthrepresentshowmanyregisterswillbewritten.Timeoutspecifiesthemaximumtimeperiod,inmilliseconds,thattheVIwaitsfortheslave'sresponsebeforethrowinganerror.errorindescribeserrorconditionsthatoccurbeforethisVIorfunctionruns.Thedefaultisnoerror.IfanerroroccurredbeforethisVIorfunctionruns,theVIorfunctionpassestheerrorinvaluetoerrorout.IfanerroroccurswhilethisVIorfunctionruns,theVIorfunctionrunsnormallyandsetsitsownerrorstatusinerrorout.UsetheSimpleErrorHandlerorGeneralErrorHandlerVIstodisplaythedescriptionoftheerrorcode.Useerrorinanderrorouttocheckerrorsandtospecifyexecutionorderbywiringerroroutfromonenodetoerrorinofthenextnode.
statusisTRUE(X)ifanerroroccurredbeforethisVIorfunctionranorFALSE(checkmark)toindicateawarningorthatnoerroroccurredbeforethisVIorfunctionran.ThedefaultisFALSE.codeistheerrororwarningcode.Thedefaultis0.IfstatusisTRUE,codeisanegativeerrorcode.IfstatusisFALSE,codeis0orawarningcode.
sourceidentifieswhereanerroroccurred.ThesourcestringincludesthenameoftheVIthatproducedtheerror,
whatinputsareinerror,andhowtoeliminatetheerror.
VISAresourcenameoutistheresourcetowhichaVISAsessionisopenedanditsclass.TheclassmatchesthatoftheVISAresourcenameinput.FormoreinformationaboutVISAresourcenames,refertotheNI-VISAHelp.ExceptionCodeisnonzeroifaMODBUSerrorhasoccurred.Theexceptioncodemappingisasfollows:0 Noerror1 Illegalfunction2 Illegaldataaddress3 Illegaldatavalue4 Failureinassociateddevice5 Acknowledge6 Busy,rejectedmessage7 NAK—NegativeacknowledgeFormoreinformationabouttheseerrorcodes,refertoyourdevice'sdocumentation.erroroutcontainserrorinformation.IferrorinindicatesthatanerroroccurredbeforethisVIorfunctionran,erroroutcontainsthesameerrorinformation.Otherwise,itdescribestheerrorstatusthatthisVIorfunctionproduces.Right-clicktheerroroutfrontpanelindicatorandselectExplainErrorfromtheshortcutmenuformoreinformationabouttheerror.
statusisTRUE(X)ifanerroroccurredorFALSE(checkmark)toindicateawarningorthatnoerroroccurred.codeistheerrororwarningcode.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourcedescribestheoriginoftheerrororwarningandis,inmostcases,thenameoftheVIorfunctionthatproducedtheerrororwarning.
MBSerialMasterQueryWriteSingleCoil(poly).viThemasterusesthisVItowriteasinglecoiltotheslave.Thiscorrespondstoapublicfunctioncodeof5intheMODBUSprotocol.
SerialParametersareparametersthatmodifythewaytheMODBUSframeisstructured.RefertotheMODBUSspecificationformoreinformationabouttheMODBUSFrame.TheSerialParametersinLabVIEWisaclustercontaininganenum(Mode)andaninteger(SlaveAddress).ModeRTUDataisrepresentedinbinaryformat.ASCIIDataisrepresentedinASCII,soitishumanreadable.
SlaveAddressThisistheaddressoftheslaveyouarecommunicatingwith.ThispropertyisusuallyvalidforRS-485networks,whichcanhavemultipleMODBUSdevicesconnectedtothesamenetwork.
Note:Consultyourdevicedocumentationtofindouthowtovalidate/changetheaddressofyourdevice.
VISAresourcenamespecifiestheresourcetobeopened.Thiscontrolalsospecifiesthesessionandclass.FormoreinformationaboutVISAresourcenames,refertotheNI-VISAHelp.Addressistheaddresslocationofthecoiltowrite.Thisaddressissometimesreferredtoasoffset.Refertoyourdevice'sdocumentationtofindthecoiladdressmapping.
BesuretospecifythecorrectaddressintheMODBUSdeviceconfigurationsoftwarefortheregisteryouwanttouseinLabVIEW.
InmostMODBUSdeviceconfigurationsoftware,youmustenteranamefortheregisteryouwanttouse.PerMODBUSconvention,theregisteraddressoftheslavedeviceiscalculatedbysubtracting1fromtheregisternamethatyouspecifyinthemasterdeviceconfigurationsoftware.TheMODBUSLabVIEWlibraryexpectsregisteraddresses,notregisternames,soyoumayneedtosubtract1fromtheaddressyoudefinedintheMODBUSdeviceconfigurationsoftware.Forexample,aregisternamedefinedas2inaMODBUSconfigurationdevicetranslatestoregisteraddress1intheHoldingRegisterstableoftheLabVIEWMODBUSlibrary,asshownbelow.MODBUSDevice
HoldingRegisterName=2
LabVIEW HoldingRegisterAddress=1
Coilisthecoiltowrite.Timeoutspecifiesthemaximumtimeperiod,inmilliseconds,thattheVIwaitsfortheslave'sresponsebeforethrowinganerror.errorindescribeserrorconditionsthatoccurbeforethisVIorfunctionruns.Thedefaultisnoerror.IfanerroroccurredbeforethisVIorfunctionruns,theVIorfunctionpassestheerrorinvaluetoerrorout.IfanerroroccurswhilethisVIorfunctionruns,theVIorfunctionrunsnormallyandsetsitsownerrorstatusinerrorout.UsetheSimpleErrorHandlerorGeneralErrorHandlerVIstodisplaythedescriptionoftheerrorcode.Useerrorinanderrorouttocheckerrorsandtospecifyexecutionorderbywiringerroroutfromonenodetoerrorinofthenextnode.
statusisTRUE(X)ifanerroroccurredbeforethisVIorfunctionranorFALSE(checkmark)toindicateawarningorthatnoerroroccurredbeforethisVIorfunctionran.ThedefaultisFALSE.codeistheerrororwarningcode.Thedefaultis0.IfstatusisTRUE,codeisanegativeerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourceidentifieswhereanerroroccurred.ThesourcestringincludesthenameoftheVIthatproducedtheerror,whatinputsareinerror,andhowtoeliminatetheerror.
VISAresourcenameoutistheresourcetowhichaVISAsessionisopenedanditsclass.TheclassmatchesthatoftheVISAresourcenameinput.FormoreinformationaboutVISAresourcenames,refertotheNI-VISAHelp.ExceptionCodeisnonzeroifaMODBUSerrorhasoccurred.Theexceptioncodemappingisasfollows:0 Noerror1 Illegalfunction2 Illegaldataaddress3 Illegaldatavalue4 Failureinassociateddevice5 Acknowledge6 Busy,rejectedmessage7 NAK—NegativeacknowledgeFormoreinformationabouttheseerrorcodes,refertoyourdevice'sdocumentation.erroroutcontainserrorinformation.IferrorinindicatesthatanerroroccurredbeforethisVIorfunctionran,erroroutcontainsthesameerrorinformation.Otherwise,itdescribestheerrorstatusthatthisVIorfunctionproduces.Right-clicktheerroroutfrontpanelindicatorandselectExplainErrorfromtheshortcutmenuformoreinformationabouttheerror.
statusisTRUE(X)ifanerroroccurredorFALSE(checkmark)toindicateawarningorthatnoerroroccurred.codeistheerrororwarningcode.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourcedescribestheoriginoftheerrororwarningandis,inmostcases,thenameoftheVIorfunctionthatproducedtheerrororwarning.
MBSerialMasterQueryWriteSingleRegister(poly).viThemasterusesthisVItowriteasingleregistertotheslave.Thiscorrespondstoapublicfunctioncodeof6intheMODBUSprotocol.
SerialParametersareparametersthatmodifythewaytheMODBUSframeisstructured.RefertotheMODBUSspecificationformoreinformationabouttheMODBUSFrame.TheSerialParametersinLabVIEWisaclustercontaininganenum(Mode)andaninteger(SlaveAddress).ModeRTUDataisrepresentedinbinaryformat.ASCIIDataisrepresentedinASCII,soitishumanreadable.
SlaveAddressThisistheaddressoftheslaveyouarecommunicatingwith.ThispropertyisusuallyvalidforRS-485networks,whichcanhavemultipleMODBUSdevicesconnectedtothesamenetwork.
Note:Consultyourdevicedocumentationtofindouthowtovalidate/changetheaddressofyourdevice.
VISAresourcenamespecifiestheresourcetobeopened.Thiscontrolalsospecifiesthesessionandclass.FormoreinformationaboutVISAresourcenames,refertotheNI-VISAHelp.Addressistheaddresslocationoftheregistertowrite.Thisaddressissometimesreferredtoasoffset.Refertoyourdevice'sdocumentationtofindtheregisteraddressmapping.
BesuretospecifythecorrectaddressintheMODBUSdeviceconfigurationsoftwarefortheregisteryouwanttouseinLabVIEW.InmostMODBUSdeviceconfigurationsoftware,youmustentera
namefortheregisteryouwanttouse.PerMODBUSconvention,theregisteraddressoftheslavedeviceiscalculatedbysubtracting1fromtheregisternamethatyouspecifyinthemasterdeviceconfigurationsoftware.TheMODBUSLabVIEWlibraryexpectsregisteraddresses,notregisternames,soyoumayneedtosubtract1fromtheaddressyoudefinedintheMODBUSdeviceconfigurationsoftware.Forexample,aregisternamedefinedas2inaMODBUSconfigurationdevicetranslatestoregisteraddress1intheHoldingRegisterstableoftheLabVIEWMODBUSlibrary,asshownbelow.MODBUSDevice
HoldingRegisterName=2
LabVIEW HoldingRegisterAddress=1
HoldingRegisteristheholdingregistertowrite.Timeoutspecifiesthemaximumtimeperiod,inmilliseconds,thattheVIwaitsfortheslave'sresponsebeforethrowinganerror.errorindescribeserrorconditionsthatoccurbeforethisVIorfunctionruns.Thedefaultisnoerror.IfanerroroccurredbeforethisVIorfunctionruns,theVIorfunctionpassestheerrorinvaluetoerrorout.IfanerroroccurswhilethisVIorfunctionruns,theVIorfunctionrunsnormallyandsetsitsownerrorstatusinerrorout.UsetheSimpleErrorHandlerorGeneralErrorHandlerVIstodisplaythedescriptionoftheerrorcode.Useerrorinanderrorouttocheckerrorsandtospecifyexecutionorderbywiringerroroutfromonenodetoerrorinofthenextnode.
statusisTRUE(X)ifanerroroccurredbeforethisVIorfunctionranorFALSE(checkmark)toindicateawarningorthatnoerroroccurredbeforethisVIorfunctionran.ThedefaultisFALSE.codeistheerrororwarningcode.Thedefaultis0.IfstatusisTRUE,codeisanegativeerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourceidentifieswhereanerroroccurred.ThesourcestringincludesthenameoftheVIthatproducedtheerror,whatinputsareinerror,andhowtoeliminatetheerror.
VISAresourcenameoutistheresourcetowhichaVISAsessionisopenedanditsclass.TheclassmatchesthatoftheVISAresourcenameinput.FormoreinformationaboutVISAresourcenames,refertotheNI-VISAHelp.ExceptionCodeisnonzeroifaMODBUSerrorhasoccurred.Theexceptioncodemappingisasfollows:0 Noerror1 Illegalfunction2 Illegaldataaddress3 Illegaldatavalue4 Failureinassociateddevice5 Acknowledge6 Busy,rejectedmessage7 NAK—NegativeacknowledgeFormoreinformationabouttheseerrorcodes,refertoyourdevice'sdocumentation.erroroutcontainserrorinformation.IferrorinindicatesthatanerroroccurredbeforethisVIorfunctionran,erroroutcontainsthesameerrorinformation.Otherwise,itdescribestheerrorstatusthatthisVIorfunctionproduces.Right-clicktheerroroutfrontpanelindicatorandselectExplainErrorfromtheshortcutmenuformoreinformationabouttheerror.
statusisTRUE(X)ifanerroroccurredorFALSE(checkmark)toindicateawarningorthatnoerroroccurred.codeistheerrororwarningcode.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourcedescribestheoriginoftheerrororwarningandis,inmostcases,thenameoftheVIorfunctionthatproducedtheerrororwarning.
IntroductiontotheSlaveVIsYoucanusetheMODBUSLibraryVIsasmastersorslaves.Whenusedasamaster,themachinethattheVIsarerunningonsendscommandsorqueriestotheslave(s).Themasterreads/writestheslave'scoils/discreteinputs/registers.Asaslave,themachinemuststorethisdatasomewhere.TheslaveVIsmakeuseofarraystostoreandaccessthisdata.ThefirstVIyoumustuseisMBSlaveInit(poly).vi,whichinitializestwo65536U16arrays(forregisters)andtwo65536Booleanarrays(forcoilsanddiscreteinputs).AllotherslaveVIsaccessthismemorylocationindifferentways.Thefollowingtabledescribestheprimarytableobjecttypesandread/writetypes.
PrimaryTables ObjectType TypeDiscreteinputs Singlebit ReadonlyCoils Singlebit Read/writeInputregisters 16-bitword ReadonlyHoldingregisters 16-bitword Read/write
MBSlaveInit(poly).viYoumustusethisVItoinitializetwo65536U16arrays(forregisters)andtwo65536Booleanarrays(forcoilsanddiscreteinputs).
errorindescribeserrorconditionsthatoccurbeforethisVIorfunctionruns.Thedefaultisnoerror.IfanerroroccurredbeforethisVIorfunctionruns,theVIorfunctionpassestheerrorinvaluetoerrorout.IfanerroroccurswhilethisVIorfunctionruns,theVIorfunctionrunsnormallyandsetsitsownerrorstatusinerrorout.UsetheSimpleErrorHandlerorGeneralErrorHandlerVIstodisplaythedescriptionoftheerrorcode.Useerrorinanderrorouttocheckerrorsandtospecifyexecutionorderbywiringerroroutfromonenodetoerrorinofthenextnode.
statusisTRUE(X)ifanerroroccurredbeforethisVIorfunctionranorFALSE(checkmark)toindicateawarningorthatnoerroroccurredbeforethisVIorfunctionran.ThedefaultisFALSE.codeistheerrororwarningcode.Thedefaultis0.IfstatusisTRUE,codeisanegativeerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourceidentifieswhereanerroroccurred.ThesourcestringincludesthenameoftheVIthatproducedtheerror,whatinputsareinerror,andhowtoeliminatetheerror.
HoldingRegistersrepresentsanemptyarrayforstoringtheholdingregisters.Coilsrepresentsanemptyarrayforstoringthecoils.erroroutcontainserrorinformation.IferrorinindicatesthatanerroroccurredbeforethisVIorfunctionran,erroroutcontainsthesameerrorinformation.Otherwise,itdescribestheerrorstatusthatthisVIorfunctionproduces.Right-clicktheerroroutfrontpanelindicatorandselectExplainErrorfromtheshortcutmenuformoreinformationabouttheerror.
statusisTRUE(X)ifanerroroccurredorFALSE
(checkmark)toindicateawarningorthatnoerroroccurred.codeistheerrororwarningcode.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourcedescribestheoriginoftheerrororwarningandis,inmostcases,thenameoftheVIorfunctionthatproducedtheerrororwarning.
MBSlaveReadAllCoils(poly).viReadsallcoilsfromtheslave'smemorytable.
errorindescribeserrorconditionsthatoccurbeforethisVIorfunctionruns.Thedefaultisnoerror.IfanerroroccurredbeforethisVIorfunctionruns,theVIorfunctionpassestheerrorinvaluetoerrorout.IfanerroroccurswhilethisVIorfunctionruns,theVIorfunctionrunsnormallyandsetsitsownerrorstatusinerrorout.UsetheSimpleErrorHandlerorGeneralErrorHandlerVIstodisplaythedescriptionoftheerrorcode.Useerrorinanderrorouttocheckerrorsandtospecifyexecutionorderbywiringerroroutfromonenodetoerrorinofthenextnode.
statusisTRUE(X)ifanerroroccurredbeforethisVIorfunctionranorFALSE(checkmark)toindicateawarningorthatnoerroroccurredbeforethisVIorfunctionran.ThedefaultisFALSE.codeistheerrororwarningcode.Thedefaultis0.IfstatusisTRUE,codeisanegativeerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourceidentifieswhereanerroroccurred.ThesourcestringincludesthenameoftheVIthatproducedtheerror,whatinputsareinerror,andhowtoeliminatetheerror.
Coilsrepresentstheentiretableusedforstoringthecoils.erroroutcontainserrorinformation.IferrorinindicatesthatanerroroccurredbeforethisVIorfunctionran,erroroutcontainsthesameerrorinformation.Otherwise,itdescribestheerrorstatusthatthisVIorfunctionproduces.Right-clicktheerroroutfrontpanelindicatorandselectExplainErrorfromtheshortcutmenuformoreinformationabouttheerror.
statusisTRUE(X)ifanerroroccurredorFALSE(checkmark)toindicateawarningorthatnoerroroccurred.codeistheerrororwarningcode.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeis0ora
warningcode.sourcedescribestheoriginoftheerrororwarningandis,inmostcases,thenameoftheVIorfunctionthatproducedtheerrororwarning.
MBSlaveReadAllDiscreteInputs(poly).viReadsalldiscreteinputsfromtheslave'smemorytable.
errorindescribeserrorconditionsthatoccurbeforethisVIorfunctionruns.Thedefaultisnoerror.IfanerroroccurredbeforethisVIorfunctionruns,theVIorfunctionpassestheerrorinvaluetoerrorout.IfanerroroccurswhilethisVIorfunctionruns,theVIorfunctionrunsnormallyandsetsitsownerrorstatusinerrorout.UsetheSimpleErrorHandlerorGeneralErrorHandlerVIstodisplaythedescriptionoftheerrorcode.Useerrorinanderrorouttocheckerrorsandtospecifyexecutionorderbywiringerroroutfromonenodetoerrorinofthenextnode.
statusisTRUE(X)ifanerroroccurredbeforethisVIorfunctionranorFALSE(checkmark)toindicateawarningorthatnoerroroccurredbeforethisVIorfunctionran.ThedefaultisFALSE.codeistheerrororwarningcode.Thedefaultis0.IfstatusisTRUE,codeisanegativeerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourceidentifieswhereanerroroccurred.ThesourcestringincludesthenameoftheVIthatproducedtheerror,whatinputsareinerror,andhowtoeliminatetheerror.
DiscreteInputsrepresentstheentiretableusedforstoringthediscreteinputs.erroroutcontainserrorinformation.IferrorinindicatesthatanerroroccurredbeforethisVIorfunctionran,erroroutcontainsthesameerrorinformation.Otherwise,itdescribestheerrorstatusthatthisVIorfunctionproduces.Right-clicktheerroroutfrontpanelindicatorandselectExplainErrorfromtheshortcutmenuformoreinformationabouttheerror.
statusisTRUE(X)ifanerroroccurredorFALSE(checkmark)toindicateawarningorthatnoerroroccurred.codeistheerrororwarningcode.IfstatusisTRUE,code
isanonzeroerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourcedescribestheoriginoftheerrororwarningandis,inmostcases,thenameoftheVIorfunctionthatproducedtheerrororwarning.
MBSlaveReadAllHoldingRegisters(poly).viReadsallholdingregistersfromtheslave'smemorytable.
errorindescribeserrorconditionsthatoccurbeforethisVIorfunctionruns.Thedefaultisnoerror.IfanerroroccurredbeforethisVIorfunctionruns,theVIorfunctionpassestheerrorinvaluetoerrorout.IfanerroroccurswhilethisVIorfunctionruns,theVIorfunctionrunsnormallyandsetsitsownerrorstatusinerrorout.UsetheSimpleErrorHandlerorGeneralErrorHandlerVIstodisplaythedescriptionoftheerrorcode.Useerrorinanderrorouttocheckerrorsandtospecifyexecutionorderbywiringerroroutfromonenodetoerrorinofthenextnode.
statusisTRUE(X)ifanerroroccurredbeforethisVIorfunctionranorFALSE(checkmark)toindicateawarningorthatnoerroroccurredbeforethisVIorfunctionran.ThedefaultisFALSE.codeistheerrororwarningcode.Thedefaultis0.IfstatusisTRUE,codeisanegativeerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourceidentifieswhereanerroroccurred.ThesourcestringincludesthenameoftheVIthatproducedtheerror,whatinputsareinerror,andhowtoeliminatetheerror.
HoldingRegistersrepresentstheentiretableusedforstoringtheholdingregisters.erroroutcontainserrorinformation.IferrorinindicatesthatanerroroccurredbeforethisVIorfunctionran,erroroutcontainsthesameerrorinformation.Otherwise,itdescribestheerrorstatusthatthisVIorfunctionproduces.Right-clicktheerroroutfrontpanelindicatorandselectExplainErrorfromtheshortcutmenuformoreinformationabouttheerror.
statusisTRUE(X)ifanerroroccurredorFALSE(checkmark)toindicateawarningorthatnoerroroccurred.codeistheerrororwarningcode.IfstatusisTRUE,code
isanonzeroerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourcedescribestheoriginoftheerrororwarningandis,inmostcases,thenameoftheVIorfunctionthatproducedtheerrororwarning.
MBSlaveReadAllInputRegisters(poly).viReadsallinputregistersfromtheslave'smemorytable.
errorindescribeserrorconditionsthatoccurbeforethisVIorfunctionruns.Thedefaultisnoerror.IfanerroroccurredbeforethisVIorfunctionruns,theVIorfunctionpassestheerrorinvaluetoerrorout.IfanerroroccurswhilethisVIorfunctionruns,theVIorfunctionrunsnormallyandsetsitsownerrorstatusinerrorout.UsetheSimpleErrorHandlerorGeneralErrorHandlerVIstodisplaythedescriptionoftheerrorcode.Useerrorinanderrorouttocheckerrorsandtospecifyexecutionorderbywiringerroroutfromonenodetoerrorinofthenextnode.
statusisTRUE(X)ifanerroroccurredbeforethisVIorfunctionranorFALSE(checkmark)toindicateawarningorthatnoerroroccurredbeforethisVIorfunctionran.ThedefaultisFALSE.codeistheerrororwarningcode.Thedefaultis0.IfstatusisTRUE,codeisanegativeerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourceidentifieswhereanerroroccurred.ThesourcestringincludesthenameoftheVIthatproducedtheerror,whatinputsareinerror,andhowtoeliminatetheerror.
InputRegistersrepresentstheentiretableusedforstoringtheinputregisters.erroroutcontainserrorinformation.IferrorinindicatesthatanerroroccurredbeforethisVIorfunctionran,erroroutcontainsthesameerrorinformation.Otherwise,itdescribestheerrorstatusthatthisVIorfunctionproduces.Right-clicktheerroroutfrontpanelindicatorandselectExplainErrorfromtheshortcutmenuformoreinformationabouttheerror.
statusisTRUE(X)ifanerroroccurredorFALSE(checkmark)toindicateawarningorthatnoerroroccurred.codeistheerrororwarningcode.IfstatusisTRUE,code
isanonzeroerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourcedescribestheoriginoftheerrororwarningandis,inmostcases,thenameoftheVIorfunctionthatproducedtheerrororwarning.
MBSlaveReadCoils(poly).viReturnstheslavecoilsfromStartingAddresstoStartingAddress+Quantity.
StartingAddressisthefirstaddresslocationofthecoilstoread.Thisaddressissometimesreferredtoasoffset.Quantityrepresentshowmanycoilstoread.TheVIreturnsthecoilsatStartingAddressandeachfollowingcoiluptoQuantity.Forexample,ifStartingAddressis0andQuantityis4,theVIreadscoilsfromaddresses0,1,2,and3.errorindescribeserrorconditionsthatoccurbeforethisVIorfunctionruns.Thedefaultisnoerror.IfanerroroccurredbeforethisVIorfunctionruns,theVIorfunctionpassestheerrorinvaluetoerrorout.IfanerroroccurswhilethisVIorfunctionruns,theVIorfunctionrunsnormallyandsetsitsownerrorstatusinerrorout.UsetheSimpleErrorHandlerorGeneralErrorHandlerVIstodisplaythedescriptionoftheerrorcode.Useerrorinanderrorouttocheckerrorsandtospecifyexecutionorderbywiringerroroutfromonenodetoerrorinofthenextnode.
statusisTRUE(X)ifanerroroccurredbeforethisVIorfunctionranorFALSE(checkmark)toindicateawarningorthatnoerroroccurredbeforethisVIorfunctionran.ThedefaultisFALSE.codeistheerrororwarningcode.Thedefaultis0.IfstatusisTRUE,codeisanegativeerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourceidentifieswhereanerroroccurred.ThesourcestringincludesthenameoftheVIthatproducedtheerror,whatinputsareinerror,andhowtoeliminatetheerror.
Coilsrepresentsthedatastoredinthecoilstable.erroroutcontainserrorinformation.IferrorinindicatesthatanerroroccurredbeforethisVIorfunctionran,erroroutcontainsthesameerrorinformation.Otherwise,itdescribestheerrorstatus
thatthisVIorfunctionproduces.Right-clicktheerroroutfrontpanelindicatorandselectExplainErrorfromtheshortcutmenuformoreinformationabouttheerror.
statusisTRUE(X)ifanerroroccurredorFALSE(checkmark)toindicateawarningorthatnoerroroccurred.codeistheerrororwarningcode.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourcedescribestheoriginoftheerrororwarningandis,inmostcases,thenameoftheVIorfunctionthatproducedtheerrororwarning.
MBSlaveReadDiscreteInputs(poly).viReturnstheslave'sdiscreteinputsfromStartingAddresstoStartingAddress+Quantity.
StartingAddressisthefirstaddresslocationofthediscreteinputstoread.Thisaddressissometimesreferredtoasoffset.Quantityrepresentshowmanydiscreteinputstoread.TheVIreturnsthediscreteinputsatStartingAddressandeachfollowingdiscreteinputuptoQuantity.Forexample,ifStartingAddressis0andQuantityis4,theVIreadsdiscreteinputsfromaddresses0,1,2,and3.errorindescribeserrorconditionsthatoccurbeforethisVIorfunctionruns.Thedefaultisnoerror.IfanerroroccurredbeforethisVIorfunctionruns,theVIorfunctionpassestheerrorinvaluetoerrorout.IfanerroroccurswhilethisVIorfunctionruns,theVIorfunctionrunsnormallyandsetsitsownerrorstatusinerrorout.UsetheSimpleErrorHandlerorGeneralErrorHandlerVIstodisplaythedescriptionoftheerrorcode.Useerrorinanderrorouttocheckerrorsandtospecifyexecutionorderbywiringerroroutfromonenodetoerrorinofthenextnode.
statusisTRUE(X)ifanerroroccurredbeforethisVIorfunctionranorFALSE(checkmark)toindicateawarningorthatnoerroroccurredbeforethisVIorfunctionran.ThedefaultisFALSE.codeistheerrororwarningcode.Thedefaultis0.IfstatusisTRUE,codeisanegativeerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourceidentifieswhereanerroroccurred.ThesourcestringincludesthenameoftheVIthatproducedtheerror,whatinputsareinerror,andhowtoeliminatetheerror.
DiscreteInputsrepresentsthedatastoredinthediscreteinputstable.erroroutcontainserrorinformation.Iferrorinindicatesthatan
erroroccurredbeforethisVIorfunctionran,erroroutcontainsthesameerrorinformation.Otherwise,itdescribestheerrorstatusthatthisVIorfunctionproduces.Right-clicktheerroroutfrontpanelindicatorandselectExplainErrorfromtheshortcutmenuformoreinformationabouttheerror.
statusisTRUE(X)ifanerroroccurredorFALSE(checkmark)toindicateawarningorthatnoerroroccurred.codeistheerrororwarningcode.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourcedescribestheoriginoftheerrororwarningandis,inmostcases,thenameoftheVIorfunctionthatproducedtheerrororwarning.
MBSlaveReadHoldingRegisters(poly).viReturnstheslaveholdingregistersfromStartingAddresstoStartingAddress+Quantity.
StartingAddressisthefirstaddresslocationoftheholdingregistertoread.Thisaddressissometimesreferredtoasoffset.Quantityrepresentshowmanyholdingregisterstoread.TheVIreturnstheholdingregistersatStartingAddressandeachfollowingholdingregisteruptoQuantity.Forexample,ifStartingAddressis0andQuantityis4,theVIreadsholdingregistersfromaddresses0,1,2,and3.errorindescribeserrorconditionsthatoccurbeforethisVIorfunctionruns.Thedefaultisnoerror.IfanerroroccurredbeforethisVIorfunctionruns,theVIorfunctionpassestheerrorinvaluetoerrorout.IfanerroroccurswhilethisVIorfunctionruns,theVIorfunctionrunsnormallyandsetsitsownerrorstatusinerrorout.UsetheSimpleErrorHandlerorGeneralErrorHandlerVIstodisplaythedescriptionoftheerrorcode.Useerrorinanderrorouttocheckerrorsandtospecifyexecutionorderbywiringerroroutfromonenodetoerrorinofthenextnode.
statusisTRUE(X)ifanerroroccurredbeforethisVIorfunctionranorFALSE(checkmark)toindicateawarningorthatnoerroroccurredbeforethisVIorfunctionran.ThedefaultisFALSE.codeistheerrororwarningcode.Thedefaultis0.IfstatusisTRUE,codeisanegativeerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourceidentifieswhereanerroroccurred.ThesourcestringincludesthenameoftheVIthatproducedtheerror,whatinputsareinerror,andhowtoeliminatetheerror.
HoldingRegistersrepresentsthedatareadfromtheslave.erroroutcontainserrorinformation.IferrorinindicatesthatanerroroccurredbeforethisVIorfunctionran,erroroutcontainsthe
sameerrorinformation.Otherwise,itdescribestheerrorstatusthatthisVIorfunctionproduces.Right-clicktheerroroutfrontpanelindicatorandselectExplainErrorfromtheshortcutmenuformoreinformationabouttheerror.
statusisTRUE(X)ifanerroroccurredorFALSE(checkmark)toindicateawarningorthatnoerroroccurred.codeistheerrororwarningcode.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourcedescribestheoriginoftheerrororwarningandis,inmostcases,thenameoftheVIorfunctionthatproducedtheerrororwarning.
MBSlaveReadInputRegisters(poly).viReturnstheslave'sinputregistersfromStartingAddresstoStartingAddress+Quantity.
StartingAddressisthefirstaddresslocationoftheinputregistertoread.Thisaddressissometimesreferredtoasoffset.Quantityrepresentshowmanyinputregisterstoread.TheVIreturnstheinputregistersatStartingAddressandeachfollowinginputregisteruptoQuantity.Forexample,ifStartingAddressis0andQuantityis4,theVIreadsinputregistersfromaddresses0,1,2,and3.errorindescribeserrorconditionsthatoccurbeforethisVIorfunctionruns.Thedefaultisnoerror.IfanerroroccurredbeforethisVIorfunctionruns,theVIorfunctionpassestheerrorinvaluetoerrorout.IfanerroroccurswhilethisVIorfunctionruns,theVIorfunctionrunsnormallyandsetsitsownerrorstatusinerrorout.UsetheSimpleErrorHandlerorGeneralErrorHandlerVIstodisplaythedescriptionoftheerrorcode.Useerrorinanderrorouttocheckerrorsandtospecifyexecutionorderbywiringerroroutfromonenodetoerrorinofthenextnode.
statusisTRUE(X)ifanerroroccurredbeforethisVIorfunctionranorFALSE(checkmark)toindicateawarningorthatnoerroroccurredbeforethisVIorfunctionran.ThedefaultisFALSE.codeistheerrororwarningcode.Thedefaultis0.IfstatusisTRUE,codeisanegativeerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourceidentifieswhereanerroroccurred.ThesourcestringincludesthenameoftheVIthatproducedtheerror,whatinputsareinerror,andhowtoeliminatetheerror.
InputRegistersrepresentsthedatareadfromtheslave.erroroutcontainserrorinformation.IferrorinindicatesthatanerroroccurredbeforethisVIorfunctionran,erroroutcontainsthe
sameerrorinformation.Otherwise,itdescribestheerrorstatusthatthisVIorfunctionproduces.Right-clicktheerroroutfrontpanelindicatorandselectExplainErrorfromtheshortcutmenuformoreinformationabouttheerror.
statusisTRUE(X)ifanerroroccurredorFALSE(checkmark)toindicateawarningorthatnoerroroccurred.codeistheerrororwarningcode.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourcedescribestheoriginoftheerrororwarningandis,inmostcases,thenameoftheVIorfunctionthatproducedtheerrororwarning.
MBSlaveWriteCoils(poly).viWritesmultiplecoilstotheslavememorytables.
StartingAddressistheaddresslocationofthefirstcoiltowrite.Thisaddressissometimesreferredtoasoffset.Coilstowrite.Thearraylengthrepresentsthequantity.errorindescribeserrorconditionsthatoccurbeforethisVIorfunctionruns.Thedefaultisnoerror.IfanerroroccurredbeforethisVIorfunctionruns,theVIorfunctionpassestheerrorinvaluetoerrorout.IfanerroroccurswhilethisVIorfunctionruns,theVIorfunctionrunsnormallyandsetsitsownerrorstatusinerrorout.UsetheSimpleErrorHandlerorGeneralErrorHandlerVIstodisplaythedescriptionoftheerrorcode.Useerrorinanderrorouttocheckerrorsandtospecifyexecutionorderbywiringerroroutfromonenodetoerrorinofthenextnode.
statusisTRUE(X)ifanerroroccurredbeforethisVIorfunctionranorFALSE(checkmark)toindicateawarningorthatnoerroroccurredbeforethisVIorfunctionran.ThedefaultisFALSE.codeistheerrororwarningcode.Thedefaultis0.IfstatusisTRUE,codeisanegativeerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourceidentifieswhereanerroroccurred.ThesourcestringincludesthenameoftheVIthatproducedtheerror,whatinputsareinerror,andhowtoeliminatetheerror.
erroroutcontainserrorinformation.IferrorinindicatesthatanerroroccurredbeforethisVIorfunctionran,erroroutcontainsthesameerrorinformation.Otherwise,itdescribestheerrorstatusthatthisVIorfunctionproduces.Right-clicktheerroroutfrontpanelindicatorandselectExplainErrorfromtheshortcutmenuformoreinformationabouttheerror.
statusisTRUE(X)ifanerroroccurredorFALSE(checkmark)toindicateawarningorthatnoerroroccurred.
codeistheerrororwarningcode.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourcedescribestheoriginoftheerrororwarningandis,inmostcases,thenameoftheVIorfunctionthatproducedtheerrororwarning.
MBSlaveWriteDiscreteInputs(poly).viWritesmultiplediscreteinputstotheslavememorytables.
StartingAddressistheaddresslocationofthefirstdiscreteinputtowrite.Thisaddressissometimesreferredtoasoffset.DiscreteInputstowrite.Thearraylengthrepresentsthequantity.
Note:Onlytheslavecanwritediscreteinputs.errorindescribeserrorconditionsthatoccurbeforethisVIorfunctionruns.Thedefaultisnoerror.IfanerroroccurredbeforethisVIorfunctionruns,theVIorfunctionpassestheerrorinvaluetoerrorout.IfanerroroccurswhilethisVIorfunctionruns,theVIorfunctionrunsnormallyandsetsitsownerrorstatusinerrorout.UsetheSimpleErrorHandlerorGeneralErrorHandlerVIstodisplaythedescriptionoftheerrorcode.Useerrorinanderrorouttocheckerrorsandtospecifyexecutionorderbywiringerroroutfromonenodetoerrorinofthenextnode.
statusisTRUE(X)ifanerroroccurredbeforethisVIorfunctionranorFALSE(checkmark)toindicateawarningorthatnoerroroccurredbeforethisVIorfunctionran.ThedefaultisFALSE.codeistheerrororwarningcode.Thedefaultis0.IfstatusisTRUE,codeisanegativeerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourceidentifieswhereanerroroccurred.ThesourcestringincludesthenameoftheVIthatproducedtheerror,whatinputsareinerror,andhowtoeliminatetheerror.
erroroutcontainserrorinformation.IferrorinindicatesthatanerroroccurredbeforethisVIorfunctionran,erroroutcontainsthesameerrorinformation.Otherwise,itdescribestheerrorstatusthatthisVIorfunctionproduces.Right-clicktheerroroutfrontpanelindicatorandselectExplainErrorfromtheshortcutmenuformoreinformationabouttheerror.
statusisTRUE(X)ifanerroroccurredorFALSE(checkmark)toindicateawarningorthatnoerroroccurred.codeistheerrororwarningcode.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourcedescribestheoriginoftheerrororwarningandis,inmostcases,thenameoftheVIorfunctionthatproducedtheerrororwarning.
MBSlaveWriteHoldingRegisters(poly).viWritesmultipleholdingregisterstotheslavememorytables.
StartingAddressistheaddresslocationofthefirstholdingregistertowrite.Thisaddressissometimesreferredtoasoffset.HoldingRegisterstowrite.Thearraylengthrepresentsthequantity.errorindescribeserrorconditionsthatoccurbeforethisVIorfunctionruns.Thedefaultisnoerror.IfanerroroccurredbeforethisVIorfunctionruns,theVIorfunctionpassestheerrorinvaluetoerrorout.IfanerroroccurswhilethisVIorfunctionruns,theVIorfunctionrunsnormallyandsetsitsownerrorstatusinerrorout.UsetheSimpleErrorHandlerorGeneralErrorHandlerVIstodisplaythedescriptionoftheerrorcode.Useerrorinanderrorouttocheckerrorsandtospecifyexecutionorderbywiringerroroutfromonenodetoerrorinofthenextnode.
statusisTRUE(X)ifanerroroccurredbeforethisVIorfunctionranorFALSE(checkmark)toindicateawarningorthatnoerroroccurredbeforethisVIorfunctionran.ThedefaultisFALSE.codeistheerrororwarningcode.Thedefaultis0.IfstatusisTRUE,codeisanegativeerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourceidentifieswhereanerroroccurred.ThesourcestringincludesthenameoftheVIthatproducedtheerror,whatinputsareinerror,andhowtoeliminatetheerror.
erroroutcontainserrorinformation.IferrorinindicatesthatanerroroccurredbeforethisVIorfunctionran,erroroutcontainsthesameerrorinformation.Otherwise,itdescribestheerrorstatusthatthisVIorfunctionproduces.Right-clicktheerroroutfrontpanelindicatorandselectExplainErrorfromtheshortcutmenuformoreinformationabouttheerror.
statusisTRUE(X)ifanerroroccurredorFALSE
(checkmark)toindicateawarningorthatnoerroroccurred.codeistheerrororwarningcode.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourcedescribestheoriginoftheerrororwarningandis,inmostcases,thenameoftheVIorfunctionthatproducedtheerrororwarning.
MBSlaveWriteInputRegisters(poly).viWritesmultipleinputregisterstotheslavememorytables.
StartingAddressistheaddresslocationofthefirstinputregistertowrite.Thisaddressissometimesreferredtoasoffset.InputRegisterstowrite.Thearraylengthrepresentsthequantity.
Note:Onlytheslavecanwriteinputregisters.errorindescribeserrorconditionsthatoccurbeforethisVIorfunctionruns.Thedefaultisnoerror.IfanerroroccurredbeforethisVIorfunctionruns,theVIorfunctionpassestheerrorinvaluetoerrorout.IfanerroroccurswhilethisVIorfunctionruns,theVIorfunctionrunsnormallyandsetsitsownerrorstatusinerrorout.UsetheSimpleErrorHandlerorGeneralErrorHandlerVIstodisplaythedescriptionoftheerrorcode.Useerrorinanderrorouttocheckerrorsandtospecifyexecutionorderbywiringerroroutfromonenodetoerrorinofthenextnode.
statusisTRUE(X)ifanerroroccurredbeforethisVIorfunctionranorFALSE(checkmark)toindicateawarningorthatnoerroroccurredbeforethisVIorfunctionran.ThedefaultisFALSE.codeistheerrororwarningcode.Thedefaultis0.IfstatusisTRUE,codeisanegativeerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourceidentifieswhereanerroroccurred.ThesourcestringincludesthenameoftheVIthatproducedtheerror,whatinputsareinerror,andhowtoeliminatetheerror.
erroroutcontainserrorinformation.IferrorinindicatesthatanerroroccurredbeforethisVIorfunctionran,erroroutcontainsthesameerrorinformation.Otherwise,itdescribestheerrorstatusthatthisVIorfunctionproduces.Right-clicktheerroroutfrontpanelindicatorandselectExplainErrorfromtheshortcutmenuformoreinformationabouttheerror.
statusisTRUE(X)ifanerroroccurredorFALSE(checkmark)toindicateawarningorthatnoerroroccurred.codeistheerrororwarningcode.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourcedescribestheoriginoftheerrororwarningandis,inmostcases,thenameoftheVIorfunctionthatproducedtheerrororwarning.
MBEthernetSlaveDemon.viTheEthernetslavedemonwaitsandestablishesconnectiontoEthernetmasters.ItthenconstantlyscanstheTCPbufferforcommandsfromthemaster.Whenitdetectsacommandfromthemaster,itupdatesthememorytableswithdataandalsorespondstothemaster'squeryfordata.YoumustusetheSlaveAPItoaccessthedatainthetables.
Portistheportnumberonwhichyouwanttolistenforaconnection.Timeoutspecifiesthemaximumtimeperiod,inmilliseconds,thattheslavewaitsforthemaster'sresponsebeforethrowinganerror.PeriodrepresentsthedurationofaMODBUScycle,orhowoftentheslavescanstheTCPbufferforcommandsfromthemasters.#ofconnectionsisthenumberofconnectionstoTCPmasters.DemonRunningistrueifthedemonisrunning(listeningforconnectionsandcommunicationwithmasters).
MBSerialInit.viInitializestheserialportspecifiedbyVISAresourcenametothespecifiedsettings.WiredatatotheVISAresourcenameinputtodeterminethepolymorphicinstancetouseormanuallyselecttheinstance.
ModeisusedtoselectwhichtypeofMODBUSframetouse.ForMBSerialInit.vi,thisaffectsthenumberofdatabitstheserialportuses.RTUDataisrepresentedinbinaryformat(8databits).ASCIIDataisrepresentedinASCII,soitishumanreadable(7databits).
VISAresourcenamespecifiestheresourcetobeopened.Thiscontrolalsospecifiesthesessionandclass.FormoreinformationaboutVISAresourcenames,refertotheNI-VISAHelp.BaudRateistherateoftransmission.Thedefaultis9600.Parityspecifiestheparityusedforeveryframetobetransmittedorreceived.Thisinputacceptsthefollowingvalues:0 Noparity(default)1 Oddparity2 Evenparity3 Markparity4 Spaceparity
errorindescribeserrorconditionsthatoccurbeforethisVIorfunctionruns.Thedefaultisnoerror.IfanerroroccurredbeforethisVIorfunctionruns,theVIorfunctionpassestheerrorinvaluetoerrorout.IfanerroroccurswhilethisVIorfunctionruns,theVIorfunctionrunsnormallyandsetsitsownerrorstatusinerrorout.
UsetheSimpleErrorHandlerorGeneralErrorHandlerVIstodisplaythedescriptionoftheerrorcode.Useerrorinanderrorouttocheckerrorsandtospecifyexecutionorderbywiringerroroutfromonenodetoerrorinofthenextnode.
statusisTRUE(X)ifanerroroccurredbeforethisVIorfunctionranorFALSE(checkmark)toindicateawarningorthatnoerroroccurredbeforethisVIorfunctionran.ThedefaultisFALSE.codeistheerrororwarningcode.Thedefaultis0.IfstatusisTRUE,codeisanegativeerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourceidentifieswhereanerroroccurred.ThesourcestringincludesthenameoftheVIthatproducedtheerror,whatinputsareinerror,andhowtoeliminatetheerror.
FlowControlsetsthetypeofcontrolthetransfermechanismuses.Thisinputacceptsthefollowingvalues:0 None(default)—Thetransfermechanismdoesnotuseflow
control.Buffersonbothsidesoftheconnectionareassumedtobelargeenoughtoholdalldatatransferred.
1 XON/XOFF—ThetransfermechanismusestheXONandXOFFcharacterstoperformflowcontrol.ThetransfermechanismcontrolsinputflowbysendingXOFFwhenthereceivebufferisnearlyfull,anditcontrolstheoutputflowbysuspendingtransmissionwhenXOFFisreceived.
2 RTS/CTS—ThetransfermechanismusestheRTSoutputsignalandtheCTSinputsignaltoperformflowcontrol.ThetransfermechanismcontrolsinputflowbyunassertingtheRTSsignalwhenthereceivebufferisnearlyfull,anditcontrolsoutputflowbysuspendingthetransmissionwhentheCTSsignalisunasserted.
3 XON/XOFFandRTS/CTS—ThetransfermechanismusestheXONandXOFFcharactersandtheRTSoutputsignalandCTSinputsignaltoperformflowcontrol.ThetransfermechanismcontrolsinputflowbysendingXOFFandunassertingtheRTSsignalwhenthereceivebufferisnearlyfull,anditcontrolstheoutputflowbysuspendingtransmission
whenXOFFisreceivedandtheCTSisunasserted.
4 DTR/DSR—ThetransfermechanismusestheDTRoutputsignalandtheDSRinputsignaltoperformflowcontrol.ThetransfermechanismcontrolsinputflowbyunassertingtheDTRsignalwhenthereceivebufferisnearlyfull,anditcontrolsoutputflowbysuspendingthetransmissionwhentheDSRsignalisunasserted.
5 XON/XOFFandDTR/DSR—ThetransfermechanismusestheXONandXOFFcharactersandtheDTRoutputsignalandDSRinputsignaltoperformflowcontrol.ThetransfermechanismcontrolsinputflowbysendingXOFFandunassertingtheDTRsignalwhenthereceivebufferisnearlyfull,anditcontrolstheoutputflowbysuspendingtransmissionwhenXOFFisreceivedandtheDSRsignalisunasserted.
Timeoutspecifiesthemaximumtimeperiod,inmilliseconds,thattheVIwaitsfortheslave'sresponsebeforethrowinganerror.VISAresourcenameoutistheresourcetowhichaVISAsessionisopenedanditsclass.TheclassmatchesthatoftheVISAresourcenameinput.FormoreinformationaboutVISAresourcenames,refertotheNI-VISAHelp.erroroutcontainserrorinformation.IferrorinindicatesthatanerroroccurredbeforethisVIorfunctionran,erroroutcontainsthesameerrorinformation.Otherwise,itdescribestheerrorstatusthatthisVIorfunctionproduces.Right-clicktheerroroutfrontpanelindicatorandselectExplainErrorfromtheshortcutmenuformoreinformationabouttheerror.
statusisTRUE(X)ifanerroroccurredorFALSE(checkmark)toindicateawarningorthatnoerroroccurred.codeistheerrororwarningcode.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourcedescribestheoriginoftheerrororwarningandis,inmostcases,thenameoftheVIorfunctionthatproducedtheerrororwarning.
MBSerialSlaveDemon.viTheserialslavedemonconstantlyscanstheserialportforcommandsfromthemaster.Whenitdetectsacommandfromthemaster,itupdatesthememorytableswithdataandalsorespondstothemaster'squeryfordata.YoumustusetheslaveAPItoaccessthedatainthetables.
SerialPortSetup(RTOnly)isrequiredtoconfiguretheserialportontheRTsystem(ifrunningPharlapRTOS).
VISAresourcenameoutistheresourcetowhichaVISAsessionisopenedanditsclass.TheclassmatchesthatoftheVISAresourcenameinput.FormoreinformationaboutVISAresourcenames,refertotheNI-VISAHelp.BaudRateistherateoftransmission.Thedefaultis9600.DataBitsisthenumberofbitsintheincomingdata.Thevalueofdatabitsisbetween5and8.Thedefaultvalueis8.Parityspecifiestheparityusedforeveryframetobetransmittedorreceived.Thisinputacceptsthefollowingvalues:0 Noparity(default)
1 Oddparity
2 Evenparity3 Markparity4 Spaceparity
StopBitsspecifiesthenumberofstopbitsusedtoindicatetheendofaframe.Thisinputacceptsthefollowingvalues:10 1stopbit15 1.5stopbits20 2stopbits
FlowControlsetsthetypeofcontrolusedbythetransfermechanism.Thisinputacceptsthefollowingvalues:0 None(default)—Thetransfermechanismdoesnotuse
flowcontrol.Buffersonbothsidesoftheconnectionareassumedtobelargeenoughtoholdalldatatransferred.
1 XON/XOFF—ThetransfermechanismusestheXONandXOFFcharacterstoperformflowcontrol.ThetransfermechanismcontrolsinputflowbysendingXOFFwhenthereceivebufferisnearlyfull,anditcontrolstheoutputflowbysuspendingtransmissionwhenXOFFisreceived.
2 RTS/CTS—ThetransfermechanismusestheRTSoutputsignalandtheCTSinputsignaltoperformflowcontrol.ThetransfermechanismcontrolsinputflowbyunassertingtheRTSsignalwhenthereceivebufferisnearlyfull,anditcontrolsoutputflowbysuspendingthetransmissionwhentheCTSsignalisunasserted.
3 XON/XOFFandRTS/CTS—ThetransfermechanismusestheXONandXOFFcharactersandtheRTSoutputsignalandCTSinputsignaltoperformflowcontrol.ThetransfermechanismcontrolsinputflowbysendingXOFFandunassertingtheRTSsignalwhenthereceivebufferisnearlyfull,anditcontrolstheoutputflowbysuspendingtransmissionwhenXOFFisreceivedandtheCTSisunasserted.
4 DTR/DSR—ThetransfermechanismusestheDTRoutputsignalandtheDSRinputsignaltoperformflowcontrol.ThetransfermechanismcontrolsinputflowbyunassertingtheDTRsignalwhenthereceivebufferisnearlyfull,anditcontrolsoutputflowbysuspendingthetransmissionwhentheDSRsignalisunasserted.
5 XON/XOFFandDTR/DSR—ThetransfermechanismusestheXONandXOFFcharactersandtheDTRoutputsignalandDSRinputsignaltoperformflowcontrol.ThetransfermechanismcontrolsinputflowbysendingXOFFandunassertingtheDTRsignalwhenthereceivebufferisnearlyfull,anditcontrolstheoutputflowbysuspendingtransmissionwhenXOFFisreceivedandtheDSRsignalisunasserted.
TerminationCharcallsforterminationofthereadoperation.ThereadoperationterminateswhentheTerminationCharisreadfromtheserialdevice.0xAisthehexequivalentofalinefeedcharacter(\n).Changetheterminationcharto0xDformessagestringsthatterminatewithacarriagereturn(\r).EnableTerminationCharpreparestheserialdevicetorecognizeterminationchar.IfTRUE(default),theportissettorecognizetheterminationcharacter.IfFALSE,theserialdevicedoesnotrecognizetheterminationchar.Timeoutspecifiesthemaximumtimeperiod,inmilliseconds,thattheVIwaitsfortheslave'sresponsebeforethrowinganerror.
SlaveAddressrepresentstheaddressoftheslaveontheMODBUSnetwork.Themastersusethisaddresstocommunicatewiththecorrectslave.VISAresourcenamesspecifiesaarrayofalltheresourcestobeopenedandusedtoconnecttomasters.Forexample,youcanusetwoserialportstoconnectaslavetomultiplemasters.Becausethisisanarrayofstrings,youcanuseaVISApropertynodetoextracttheVISAresourcenamefromaVISASessioncontrol.RefertoMBSerialSlaveExample.viforanexample.
ModesselectswhichtypeofMODBUSframetouse.Thisisanarrayofclusters.EacharraylocationcorrespondstothemodesettingforthecorrespondingVISAsessionintheVISAresourcenamesarray.RTUDataisrepresentedinbinaryformat(8databits).
ASCIIDataisrepresentedinASCII,soitishumanreadable(7databits).
Timeoutsspecifiesthemaximumtimeperiod,inmilliseconds,thattheslavewaitsforthemaster'sresponsebeforethrowinganerror.EachlocationinthearrayrepresentsthesettingforthecorrespondingVISAresourcefromtheVISAresourcenamesarray.PeriodrepresentsthedurationofaMODBUScycle,orhowoftentheslavescanstheserialports.
ImportantInformationWarrantyCopyrightTrademarksPatentsWarningRegardingUseofNIProducts
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,includingnegligence.AnyactionagainstNationalInstrumentsmustbebroughtwithinoneyearafterthecauseofaction
accrues.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®istheregisteredtrademarkofAppleInc.HandleGraphics®,MATLAB®,Real-TimeWorkshop®,Simulink®,Stateflow®,andxPCTargetBox®areregisteredtrademarks,andTargetBox™andTargetLanguageCompiler™aretrademarksofTheMathWorks,Inc.Tektronix®andTekareregisteredtrademarksofTektronix,Inc.TheBluetooth®wordmarkisaregisteredtrademarkownedbytheBluetoothSIG,Inc.Otherproductandcompanynamesmentionedhereinaretrademarksortradenamesoftheirrespectivecompanies.MembersoftheNationalInstrumentsAlliancePartnerProgramarebusinessentitiesindependentfromNationalInstrumentsandhavenoagency,partnership,orjoint-venturerelationshipwithNationalInstruments.
PatentsForpatentscoveringtheNationalInstrumentsproducts/technology,refertotheappropriatelocation:Help»Patentsinyoursoftware,thepatents.txtfileonyourmedia,ortheNationalInstrumentsPatentNoticeatni.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-USERSYSTEMISCUSTOMIZEDANDDIFFERSFROMNATIONALINSTRUMENTS'TESTINGPLATFORMSANDBECAUSEAUSERORAPPLICATIONDESIGNERMAYUSENATIONALINSTRUMENTSPRODUCTSINCOMBINATIONWITHOTHERPRODUCTSINAMANNERNOTEVALUATEDORCONTEMPLATEDBYNATIONALINSTRUMENTS,THEUSEROR
APPLICATIONDESIGNERISULTIMATELYRESPONSIBLEFORVERIFYINGANDVALIDATINGTHESUITABILITYOFNATIONALINSTRUMENTSPRODUCTSWHENEVERNATIONALINSTRUMENTSPRODUCTSAREINCORPORATEDINASYSTEMORAPPLICATION,INCLUDING,WITHOUTLIMITATION,THEAPPROPRIATEDESIGN,PROCESSANDSAFETYLEVELOFSUCHSYSTEMORAPPLICATION.
TechnicalSupportandProfessionalServicesVisitthefollowingsectionsoftheaward-winningNationalInstrumentsWebsiteatni.comfortechnicalsupportandprofessionalservices:
Support—Technicalsupportatni.com/supportincludesthefollowingresources:
Self-HelpResources—Foranswersandsolutions,visitni.com/supportforsoftwaredriversandupdates,asearchableKnowledgeBase,productmanuals,step-by-steptroubleshootingwizards,thousandsofexampleprograms,tutorials,applicationnotes,instrumentdrivers,andsoon.RegisteredusersalsoreceiveaccesstotheNIDiscussionForumsatni.com/forums.NIApplicationsEngineersmakesureeveryquestionsubmittedonlinereceivesananswer.StandardServiceProgramMembership—ThisprogramentitlesmemberstodirectaccesstoNIApplicationsEngineersviaphoneandemailforone-to-onetechnicalsupport,aswellasexclusiveaccesstoondemandtrainingmodulesviatheServicesResourceCenter.NIofferscomplementarymembershipforafullyearafterpurchase,afterwhichyoumayrenewtocontinueyourbenefits.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/niglobaltoaccessthebranchoffice
Websites,whichprovideup-to-datecontactinformation,supportphonenumbers,emailaddresses,andcurrentevents.
NoteModbusLabVIEWlibrarysupportisbye-mailonly;phonesupportisnotavailable.
BranchOfficesOffice TelephoneNumberAustralia 1800300800Austria 43662457990-0Belgium 32(0)27570020Brazil 551132623599Canada 8004333488China 862150509800CzechRepublic 420224235774Denmark 4545762600Finland 358(0)972572511France 33(0)157662424Germany 49897413130India 918041190000Israel 972036393737Italy 390241309277Japan 0120-527196/81354722970Korea 820234513400Lebanon 961(0)1332828Malaysia 1800887710Mexico 018000100793Netherlands 31(0)348433466NewZealand 0800553322Norway 47(0)66907660Poland 48223289010Portugal 351210311210Russia 74957836851Singapore 18002265886Slovenia 38634254200
SouthAfrica 270118058197Spain 34916400085Sweden 46(0)858789500Switzerland 41562005151Taiwan 8860223772222Thailand 6622786777Turkey 902122793031UnitedKingdom 44(0)1635523545UnitedStates(Corporate) 5126830100