modbus labview library help · modbus labview library help february 2009, 372767a-01 this help file...
TRANSCRIPT
![Page 1: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/1.jpg)
![Page 2: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/2.jpg)
ModbusLabVIEWLibraryHelpFebruary2009,372767A-01ThishelpfiledescribestheModbusLabVIEWVIlibrary.Formoreinformationaboutthishelpfile,refertothefollowingtopics:UsingHelpImportantInformationTechnicalSupportandProfessionalServicesTocommentonNationalInstrumentsdocumentation,refertotheNationalInstrumentsWebsite.©2009NationalInstrumentsCorporation.Allrightsreserved.
![Page 3: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/3.jpg)
UsingHelpConventionsNavigatingHelpSearchingHelpPrintingHelpFileTopics
![Page 4: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/4.jpg)
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.
![Page 5: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/5.jpg)
NavigatingHelp(WindowsOnly)Tonavigatethishelpfile,usetheContents,Index,andSearchtabstotheleftofthiswindoworusethefollowingtoolbarbuttonslocatedabovethetabs:
NoteTheinformationinthistopiconlyappliestothehelpfileinstalledwiththeWindowsversionofthesoftware.Hide—Hidesthenavigationpanefromview.Locate—LocatesthecurrentlydisplayedtopicintheContentstab,allowingyoutoviewrelatedtopics.Back—Displaysthepreviouslyviewedtopic.Forward—DisplaysthetopicyouviewedbeforeclickingtheBackbutton.Options—Displaysalistofcommandsandviewingoptionsforthehelpfile.
![Page 6: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/6.jpg)
SearchingHelp(WindowsOnly)UsetheSearchtabtotheleftofthiswindowtolocatecontentinthishelpfile.
NoteTheinformationinthistopiconlyappliestothehelpfileinstalledwiththeWindowsversionofthesoftware.
Ifyouwanttosearchforwordsinacertainorder,suchas"relateddocumentation,"addquotationmarksaroundthesearchwordsasshownintheexample.SearchingfortermsontheSearchtaballowsyoutoquicklylocatespecificinformationandinformationintopicsthatarenotincludedontheContentstab.
TipYoucantemporarilydisablethesearchhighlightingfeaturebyselectingOptions»SearchHighlightOfffromthetoolbar.
![Page 7: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/7.jpg)
WildcardsYoualsocansearchusingasterisk(*)orquestionmark(?)wildcards.Usetheasteriskwildcardtoreturntopicsthatcontainacertainstring.Forexample,asearchfor"prog*"liststopicsthatcontainthewords"program,""programmatically,""progress,"andsoon.Usethequestionmarkwildcardasasubstituteforasinglecharacterinasearchterm.Forexample,"?ext"liststopicsthatcontainthewords"next,""text,"andsoon.
NoteWildcardsearchingwillnotworkonSimplifiedChinese,TraditionalChinese,Japanese,andKoreansystems.
![Page 8: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/8.jpg)
NestedExpressionsUsenestedexpressionstocombinesearchestofurtherrefineasearch.YoucanuseBooleanexpressionsandwildcardsinanestedexpression.Forexample,"exampleAND(programORVI)"liststopicsthatcontain"exampleprogram"or"exampleVI."Youcannotnestexpressionsmorethanfivelevels.
![Page 9: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/9.jpg)
BooleanExpressionsClickthe buttontoaddBooleanexpressionstoasearch.ThefollowingBooleanoperatorsareavailable:
AND(default)—Returnstopicsthatcontainbothsearchterms.Youdonotneedtospecifythisoperatorunlessyouareusingnestedexpressions.OR—Returnstopicsthatcontaineitherthefirstorsecondterm.NOT—Returnstopicsthatcontainthefirsttermwithoutthesecondterm.NEAR—Returnstopicsthatcontainbothtermswithineightwordsofeachother.
![Page 10: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/10.jpg)
SearchOptions
UsethefollowingcheckboxesontheSearchtabtocustomizeasearch:Searchpreviousresults—Narrowstheresultsfromasearchthatreturnedtoomanytopics.Youmustremovethecheckmarkfromthischeckboxtosearchalltopics.Matchsimilarwords—Broadensasearchtoreturntopicsthatcontainwordssimilartothesearchterms.Forexample,asearchfor"program"liststopicsthatincludethewords"programs,""programming,"andsoon.Searchtitlesonly—Searchesonlyinthetitlesoftopics.
![Page 11: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/11.jpg)
PrintingHelpFileTopics(WindowsOnly)CompletethefollowingstepstoprintanentirebookfromtheContentstab:
NoteTheinformationinthistopiconlyappliestothehelpfileinstalledwiththeWindowsversionofthesoftware.
1. Right-clickthebook.2. SelectPrintfromtheshortcutmenutodisplaythePrintTopics
dialogbox.3. SelectthePrinttheselectedheadingandallsubtopicsoption.
NoteSelectPrinttheselectedtopicifyouwanttoprintthesingletopicyouhaveselectedintheContentstab.
4. ClicktheOKbutton.
![Page 12: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/12.jpg)
PrintingPDFDocumentsThishelpfilemaycontainlinkstoPDFdocuments.ToprintPDFdocuments,clicktheprintbuttonlocatedontheAdobeAcrobatViewertoolbar.
![Page 13: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/13.jpg)
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
![Page 14: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/14.jpg)
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.
![Page 15: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/15.jpg)
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.
![Page 16: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/16.jpg)
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
![Page 17: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/17.jpg)
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.
![Page 18: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/18.jpg)
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.
![Page 19: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/19.jpg)
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
![Page 20: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/20.jpg)
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
![Page 21: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/21.jpg)
warningcode.sourcedescribestheoriginoftheerrororwarningandis,inmostcases,thenameoftheVIorfunctionthatproducedtheerrororwarning.
![Page 22: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/22.jpg)
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
![Page 23: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/23.jpg)
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.
![Page 24: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/24.jpg)
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.
![Page 25: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/25.jpg)
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
![Page 26: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/26.jpg)
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.
![Page 27: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/27.jpg)
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.
![Page 28: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/28.jpg)
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
![Page 29: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/29.jpg)
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
![Page 30: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/30.jpg)
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.
![Page 31: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/31.jpg)
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
![Page 32: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/32.jpg)
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
![Page 33: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/33.jpg)
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.
![Page 34: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/34.jpg)
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
![Page 35: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/35.jpg)
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
![Page 36: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/36.jpg)
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.
![Page 37: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/37.jpg)
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
![Page 38: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/38.jpg)
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
![Page 39: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/39.jpg)
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.
![Page 40: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/40.jpg)
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,
![Page 41: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/41.jpg)
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,
![Page 42: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/42.jpg)
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.
![Page 43: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/43.jpg)
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.
![Page 44: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/44.jpg)
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,
![Page 45: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/45.jpg)
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.
![Page 46: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/46.jpg)
sourcedescribestheoriginoftheerrororwarningandis,inmostcases,thenameoftheVIorfunctionthatproducedtheerrororwarning.
![Page 47: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/47.jpg)
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
![Page 48: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/48.jpg)
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
![Page 49: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/49.jpg)
panelindicatorandselectExplainErrorfromtheshortcutmenuformoreinformationabouttheerror.
statusisTRUE(X)ifanerroroccurredorFALSE(checkmark)toindicateawarningorthatnoerroroccurred.codeistheerrororwarningcode.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourcedescribestheoriginoftheerrororwarningandis,inmostcases,thenameoftheVIorfunctionthatproducedtheerrororwarning.
![Page 50: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/50.jpg)
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.
![Page 51: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/51.jpg)
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,
![Page 52: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/52.jpg)
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.
![Page 53: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/53.jpg)
sourcedescribestheoriginoftheerrororwarningandis,inmostcases,thenameoftheVIorfunctionthatproducedtheerrororwarning.
![Page 54: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/54.jpg)
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.
![Page 55: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/55.jpg)
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,
![Page 56: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/56.jpg)
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.
![Page 57: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/57.jpg)
sourcedescribestheoriginoftheerrororwarningandis,inmostcases,thenameoftheVIorfunctionthatproducedtheerrororwarning.
![Page 58: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/58.jpg)
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
![Page 59: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/59.jpg)
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.
![Page 60: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/60.jpg)
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.
![Page 61: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/61.jpg)
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
![Page 62: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/62.jpg)
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,
![Page 63: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/63.jpg)
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.
![Page 64: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/64.jpg)
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.
![Page 65: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/65.jpg)
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.
![Page 66: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/66.jpg)
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.
![Page 67: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/67.jpg)
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
![Page 68: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/68.jpg)
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.
![Page 69: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/69.jpg)
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.
![Page 70: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/70.jpg)
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
![Page 71: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/71.jpg)
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
![Page 72: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/72.jpg)
(checkmark)toindicateawarningorthatnoerroroccurred.codeistheerrororwarningcode.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourcedescribestheoriginoftheerrororwarningandis,inmostcases,thenameoftheVIorfunctionthatproducedtheerrororwarning.
![Page 73: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/73.jpg)
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
![Page 74: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/74.jpg)
warningcode.sourcedescribestheoriginoftheerrororwarningandis,inmostcases,thenameoftheVIorfunctionthatproducedtheerrororwarning.
![Page 75: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/75.jpg)
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
![Page 76: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/76.jpg)
isanonzeroerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourcedescribestheoriginoftheerrororwarningandis,inmostcases,thenameoftheVIorfunctionthatproducedtheerrororwarning.
![Page 77: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/77.jpg)
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
![Page 78: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/78.jpg)
isanonzeroerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourcedescribestheoriginoftheerrororwarningandis,inmostcases,thenameoftheVIorfunctionthatproducedtheerrororwarning.
![Page 79: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/79.jpg)
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
![Page 80: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/80.jpg)
isanonzeroerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourcedescribestheoriginoftheerrororwarningandis,inmostcases,thenameoftheVIorfunctionthatproducedtheerrororwarning.
![Page 81: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/81.jpg)
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
![Page 82: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/82.jpg)
thatthisVIorfunctionproduces.Right-clicktheerroroutfrontpanelindicatorandselectExplainErrorfromtheshortcutmenuformoreinformationabouttheerror.
statusisTRUE(X)ifanerroroccurredorFALSE(checkmark)toindicateawarningorthatnoerroroccurred.codeistheerrororwarningcode.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourcedescribestheoriginoftheerrororwarningandis,inmostcases,thenameoftheVIorfunctionthatproducedtheerrororwarning.
![Page 83: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/83.jpg)
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
![Page 84: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/84.jpg)
erroroccurredbeforethisVIorfunctionran,erroroutcontainsthesameerrorinformation.Otherwise,itdescribestheerrorstatusthatthisVIorfunctionproduces.Right-clicktheerroroutfrontpanelindicatorandselectExplainErrorfromtheshortcutmenuformoreinformationabouttheerror.
statusisTRUE(X)ifanerroroccurredorFALSE(checkmark)toindicateawarningorthatnoerroroccurred.codeistheerrororwarningcode.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourcedescribestheoriginoftheerrororwarningandis,inmostcases,thenameoftheVIorfunctionthatproducedtheerrororwarning.
![Page 85: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/85.jpg)
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
![Page 86: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/86.jpg)
sameerrorinformation.Otherwise,itdescribestheerrorstatusthatthisVIorfunctionproduces.Right-clicktheerroroutfrontpanelindicatorandselectExplainErrorfromtheshortcutmenuformoreinformationabouttheerror.
statusisTRUE(X)ifanerroroccurredorFALSE(checkmark)toindicateawarningorthatnoerroroccurred.codeistheerrororwarningcode.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourcedescribestheoriginoftheerrororwarningandis,inmostcases,thenameoftheVIorfunctionthatproducedtheerrororwarning.
![Page 87: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/87.jpg)
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
![Page 88: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/88.jpg)
sameerrorinformation.Otherwise,itdescribestheerrorstatusthatthisVIorfunctionproduces.Right-clicktheerroroutfrontpanelindicatorandselectExplainErrorfromtheshortcutmenuformoreinformationabouttheerror.
statusisTRUE(X)ifanerroroccurredorFALSE(checkmark)toindicateawarningorthatnoerroroccurred.codeistheerrororwarningcode.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourcedescribestheoriginoftheerrororwarningandis,inmostcases,thenameoftheVIorfunctionthatproducedtheerrororwarning.
![Page 89: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/89.jpg)
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.
![Page 90: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/90.jpg)
codeistheerrororwarningcode.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourcedescribestheoriginoftheerrororwarningandis,inmostcases,thenameoftheVIorfunctionthatproducedtheerrororwarning.
![Page 91: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/91.jpg)
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.
![Page 92: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/92.jpg)
statusisTRUE(X)ifanerroroccurredorFALSE(checkmark)toindicateawarningorthatnoerroroccurred.codeistheerrororwarningcode.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourcedescribestheoriginoftheerrororwarningandis,inmostcases,thenameoftheVIorfunctionthatproducedtheerrororwarning.
![Page 93: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/93.jpg)
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
![Page 94: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/94.jpg)
(checkmark)toindicateawarningorthatnoerroroccurred.codeistheerrororwarningcode.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourcedescribestheoriginoftheerrororwarningandis,inmostcases,thenameoftheVIorfunctionthatproducedtheerrororwarning.
![Page 95: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/95.jpg)
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.
![Page 96: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/96.jpg)
statusisTRUE(X)ifanerroroccurredorFALSE(checkmark)toindicateawarningorthatnoerroroccurred.codeistheerrororwarningcode.IfstatusisTRUE,codeisanonzeroerrorcode.IfstatusisFALSE,codeis0orawarningcode.sourcedescribestheoriginoftheerrororwarningandis,inmostcases,thenameoftheVIorfunctionthatproducedtheerrororwarning.
![Page 97: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/97.jpg)
MBEthernetSlaveDemon.viTheEthernetslavedemonwaitsandestablishesconnectiontoEthernetmasters.ItthenconstantlyscanstheTCPbufferforcommandsfromthemaster.Whenitdetectsacommandfromthemaster,itupdatesthememorytableswithdataandalsorespondstothemaster'squeryfordata.YoumustusetheSlaveAPItoaccessthedatainthetables.
Portistheportnumberonwhichyouwanttolistenforaconnection.Timeoutspecifiesthemaximumtimeperiod,inmilliseconds,thattheslavewaitsforthemaster'sresponsebeforethrowinganerror.PeriodrepresentsthedurationofaMODBUScycle,orhowoftentheslavescanstheTCPbufferforcommandsfromthemasters.#ofconnectionsisthenumberofconnectionstoTCPmasters.DemonRunningistrueifthedemonisrunning(listeningforconnectionsandcommunicationwithmasters).
![Page 98: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/98.jpg)
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.
![Page 99: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/99.jpg)
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
![Page 100: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/100.jpg)
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.
![Page 101: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/101.jpg)
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
![Page 102: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/102.jpg)
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.
![Page 103: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/103.jpg)
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.
![Page 104: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/104.jpg)
ModesselectswhichtypeofMODBUSframetouse.Thisisanarrayofclusters.EacharraylocationcorrespondstothemodesettingforthecorrespondingVISAsessionintheVISAresourcenamesarray.RTUDataisrepresentedinbinaryformat(8databits).
ASCIIDataisrepresentedinASCII,soitishumanreadable(7databits).
Timeoutsspecifiesthemaximumtimeperiod,inmilliseconds,thattheslavewaitsforthemaster'sresponsebeforethrowinganerror.EachlocationinthearrayrepresentsthesettingforthecorrespondingVISAresourcefromtheVISAresourcenamesarray.PeriodrepresentsthedurationofaMODBUScycle,orhowoftentheslavescanstheserialports.
![Page 105: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/105.jpg)
ImportantInformationWarrantyCopyrightTrademarksPatentsWarningRegardingUseofNIProducts
![Page 106: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/106.jpg)
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
![Page 107: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/107.jpg)
accrues.NationalInstrumentsshallnotbeliableforanydelayinperformanceduetocausesbeyonditsreasonablecontrol.Thewarrantyprovidedhereindoesnotcoverdamages,defects,malfunctions,orservicefailurescausedbyowner'sfailuretofollowtheNationalInstrumentsinstallation,operation,ormaintenanceinstructions;owner'smodificationoftheproduct;owner'sabuse,misuse,ornegligentacts;andpowerfailureorsurges,fire,flood,accident,actionsofthirdparties,orothereventsoutsidereasonablecontrol.
![Page 108: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/108.jpg)
CopyrightUnderthecopyrightlaws,thispublicationmaynotbereproducedortransmittedinanyform,electronicormechanical,includingphotocopying,recording,storinginaninformationretrievalsystem,ortranslating,inwholeorinpart,withoutthepriorwrittenconsentofNationalInstrumentsCorporation.NationalInstrumentsrespectstheintellectualpropertyofothers,andweaskouruserstodothesame.NIsoftwareisprotectedbycopyrightandotherintellectualpropertylaws.WhereNIsoftwaremaybeusedtoreproducesoftwareorothermaterialsbelongingtoothers,youmayuseNIsoftwareonlytoreproducematerialsthatyoumayreproduceinaccordancewiththetermsofanyapplicablelicenseorotherlegalrestriction.
![Page 109: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/109.jpg)
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.
![Page 110: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/110.jpg)
PatentsForpatentscoveringtheNationalInstrumentsproducts/technology,refertotheappropriatelocation:Help»Patentsinyoursoftware,thepatents.txtfileonyourmedia,ortheNationalInstrumentsPatentNoticeatni.com/patents.
![Page 111: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/111.jpg)
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
![Page 112: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/112.jpg)
APPLICATIONDESIGNERISULTIMATELYRESPONSIBLEFORVERIFYINGANDVALIDATINGTHESUITABILITYOFNATIONALINSTRUMENTSPRODUCTSWHENEVERNATIONALINSTRUMENTSPRODUCTSAREINCORPORATEDINASYSTEMORAPPLICATION,INCLUDING,WITHOUTLIMITATION,THEAPPROPRIATEDESIGN,PROCESSANDSAFETYLEVELOFSUCHSYSTEMORAPPLICATION.
![Page 113: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/113.jpg)
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
![Page 114: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/114.jpg)
Websites,whichprovideup-to-datecontactinformation,supportphonenumbers,emailaddresses,andcurrentevents.
NoteModbusLabVIEWlibrarysupportisbye-mailonly;phonesupportisnotavailable.
![Page 115: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/115.jpg)
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
![Page 116: Modbus LabVIEW Library Help · Modbus LabVIEW Library Help February 2009, 372767A-01 This help file describes the Modbus LabVIEW VI library. For more information about this help file,](https://reader035.vdocuments.us/reader035/viewer/2022081512/5e3b846745df63213d022327/html5/thumbnails/116.jpg)
SouthAfrica 270118058197Spain 34916400085Sweden 46(0)858789500Switzerland 41562005151Taiwan 8860223772222Thailand 6622786777Turkey 902122793031UnitedKingdom 44(0)1635523545UnitedStates(Corporate) 5126830100