Vision and Logic Master Programming Advanced34.docx
《Vision and Logic Master Programming Advanced34.docx》由会员分享,可在线阅读,更多相关《Vision and Logic Master Programming Advanced34.docx(13页珍藏版)》请在冰豆网上搜索。
![Vision and Logic Master Programming Advanced34.docx](https://file1.bdocx.com/fileroot1/2022-10/11/b882ff7f-180d-4de4-8d23-9e5379dd88a4/b882ff7f-180d-4de4-8d23-9e5379dd88a41.gif)
VisionandLogicMasterProgrammingAdvanced34
VisionandLogicMasterProgrammingAdvanced
Lesson3&4
TableofContents
ModbusProtocol2
ControlModbusLighting4
FeedbackandSynchronous9
ModbusProtocol
1.ToUnderstandModbusProtocol
PlantoControlaDimmerPanelwithRS-485ModbusProtocol
2.SummarizeWhatNeedtoControl
CommunicationPortSet
1)Serial:
RS-485(RTX+,RTX-)
2)PortSetup:
9600bps,NonParity,8data,1stop
3)CheckSum:
CRC-16
0110300100010200015642-1ChannelOn
0110300100010200009782-1ChannelOff
0110300200010200015671-2ChannelOn
01103002000102000097B1-2ChannelOff
01103003000102000157A0-3ChannelOn
0110300300010200009660-3ChannelOff
0110300400010200015617-4ChannelOn
01103004000102000097D7-4ChannelOff
01103000000102000FD657-4ChannelAllOn
01103000000102003FD643-6ChannelAllon
011030000001020003D652-1/2ChannelOn,3/4/5/6Off
011030000001020003D652-1/2ChannelOn
0110300000010200009653-1/2ChannelOff
0110301100010200009512-1DimChannel0%
01103011000102003214C7-1DimChannel50%
01103011000102006494F9-1DimChannel100%
0110301200010200009521-2DimChannel0%
01103012000102001C94E8-2DimChannel28%
01103012000102006494CA-2DimChannel100%
0110301000010200015503-1SceneOn
01103010000102000094C3-1SceneOff
AnalysisOneCommand:
ACRCChecksumToolsMayNeedtoTestControlCode.
ControlModbusLighting
1.DesignandMakeUI
2.CreateLMProject
ConfigControllerwithRS-485onCOME
3.NameUISignals
4.InterlockandToggleFeedback
5.ConsiderProgramStructure
6.UnderstandAnalogtoSerialModule
7.InitialEachByteofCommandString
8.ScaleAnalogFrom65536to100
9.OutputandDebug
FeedbackandSynchronous
1.GetFeedbackString
RS-232/422/485SerialCommunicationareEssentiallyDataFlow.TheFlowMayNotConsecutive,itisalwaysoneSegmentbyAnother.SoneedGather.
TheSerialGatherModuleevaluatesitsserialinputstringuntilitfindsthecharacterspecifiedintheparameter.Thenittransmitsthedelimitedportionofthestring(includingthe)andthefollowingspecifiedcharactersasanewstringto.
parametershouldabidetostringformat.Itcanbedefinedasoneormultiplecharacters.
Theparametershouldnotexceedthestringlengthbymorethan64.Thatistherangewith0dto64d.
TheSerialGathersymbolisusefulfortakingdatathatmayarriveinpieces,suchasdatafromaCOMport,andreissuingthedatainonepiece(Package).
2.DIMFeedbacktoUI
3.DIMFeedbacktoUIChannel2
4.HeartbeatOSCSentRequestStringtoDIMMER
5.USEBUFFERModuleSolveMultipleDefinition
6.TimingConditionToGateOscillator
TheTargetControlledDIMMERRestricttoContinuousCommand.ProgramShouldIntervalRequestCommandandControlCommand
7.TimingConditionToSendCommand
UpdateAnalogVariableValuebeforeSendingNewCommand
8.FeedbackofON/OFFStatus
TheSerialtoAnalogsymbolevaluatesitsserialinputstringuntilitfindsanexactmatchwiththestring(orstringfragment)thatisdefinedbythe
parameters.
Theexpectedinputstringmustbeofafixedlengthandinaknownformat,andeach
parametermustcorrespondtoonebyteoftheinputstring.
1.
=0000hsignifiesthatthecharacterisirrelevantandcanbeignored.
2.
=01xxhsignifiesthatthecharactermustmatchxx.
3.
=0200hidentifiesacharacterthatistobeextractedandtransmitted.
9.
FeedbackStatustoToggle
KeepToggleModuleallInputSignalTransient“High”
10.COMOutputMethodTwo
MakeSureCOMOutputCommandNotJammed:
AlwaysOnebyOne