Jump to content

Recommended Posts

I am developing an instrument that will serve its data on an RS485 ModBus network.  I am using a V700 Vision controller, programmed using Visilogic.  The end user should be able to set the communication parameters for that network.  In order to do this I would like to have a screen display the options for Baud Rate, Data Bits, Stop Bits, Parity, Instrument ID(address on 485 net).  The user should be able to set these parameters and then press a button and have the com port initialize using these parameters.  I have not been able to figure out how to do this.  Am I missing some key information in the manual?

I have done this with an ethernet connection previously... Modbus over IP.  I have a screen where the IP address, network mask, gateway and Port number are all entered then the connection is reconfigured/reinitialized when the button is pressed with the new information.

Is this possible with the RS 485 "Com init"?

Link to post
Share on other sites

My understanding of this is that what you want to do is not possible, but I might be wrong.  Your modbus over IP can be altered because of the totally different way the info exchange is done.  With a 232/485 serial stream, the hardware has to know exactly how it is meant to be working, whereas resetting an IP port is essentially using the same settings with different names.

It got me thinking as to whether the power up bit setting the com port could have a user set direct contact in front of it that is then linked to a setup screen.  You have all the variations in the com init settings that you might encounter linked to a particular contact that is chosen using a screen after first powerup, and this then controls the associated com init on next powerup.  But there's also the modbus config block that only works with constants, so you are getting into serious "multi-possible-configurations" here.

I'm happy to be howled down on this one, have never had to do it as I always use 9600, 8, none, 1 and adjust other things on the network to suit if needed.  I have had comms issues with other settings.

cheers, Aus

Link to post
Share on other sites

I have not tried and yet do not know if it is possible to use the built-in com port without initialization in the program.

Perhaps this will work using the settings that are available in the info Mode window of the panel itself.
There are all  settings present in info Mode for all ports.

Modbus must configured by

26 minutes ago, Flex727 said:

set up multiple pre-set

Is it solution Flex727, Ausman?

What do you think about this?

Link to post
Share on other sites

Ausman and Flex727 thank you for the replies.  I was hoping the answer was that the parameters were saved in a system register that could be altered and then the port could be reinitialized.   Having a couple of baud rate options (preset) as a minimum to choose from could work.  The network ID is already configurable through the modbus init.......

one other question... can the com port be initialized if it has already been initialized?  ie if I set it to 9600 as a default but the end user wants to set it to 19200 can the comport init and modbus init be recalled with out error?....

Link to post
Share on other sites
1 hour ago, kratmel said:

Is it solution Flex727, Ausman?

The builtin always defaults to certain parameters.  You can change them via info, but on any reboot such settings would be lost.  That is the problem.  And the only way I can see of getting around it is the "presets selected by a bit that controls the relevant power up bit" method.

Also, if doing this, you would have to have all the "controlling" bits interlinked so that only one could be active.

1 hour ago, MisterB.Ohio said:

The network ID is already configurable through the modbus init.

Yes, it is, but again only at power up, as it only uses direct addressing.  So it needs to be in your list as well...that's why I was saying it is a big preset list!

Again, happy to be proven wrong, but keep in mind it is a totally different kettle of fish to the IP method.

cheers, Aus


Link to post
Share on other sites


1 hour ago, Ausman said:

any reboot such settings would be lost

I tried to change the settings through the info Mode in the V1040 panel (com2 for example 57600>to>9600, RS232>to>RS485).
After confirming settings,  i tried to restart the panel - the settings remained unchanged (9600, RS485 - new setting is active).

The question remains:

is it possible to use com port in OPLC without COM init block in the program?

Visilogic Help say - COM init needed for communication.

Com init block change default com settings (preset in info Mode) to user defined. Maybe If changes not needed  this block is optional.

I will try to do some experimenting to answer this question

Link to post
Share on other sites
50 minutes ago, kratmel said:

the settings remained unchanged

Well...that is not what I remembered happening, so maybe I am mistaken in my belief that it doesn't stick!  Was it a full power off for a few seconds and power on?  If it was, maybe the bigger Visions do this...I have only ever used smaller ones like 130s.  If it does stick, I can't see why it won't work.  Pls do experiment, kratmel!  I haven't got time today to do so.....will try another day.



Link to post
Share on other sites
On 2/13/2019 at 6:10 PM, kratmel said:

is it possible to use com port in OPLC without COM init block in the program?

No.  Without COM INIT block the system keeps the serial port all to itself.

However, you can re-init the COM block from logic:


This is really useful for the Ethernet port, which allows specification of IP addresses via MIs.  It doesn't really help for the serial port-


The only reason to re-init the block is if you make COM changes and download them without cycling PLC power.


Joe T.



Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...