|
Hi Russell,
My thoughts are in-line:
Currently I have the pick to light device plugged into COM port 7 of myPC via USB.
I am then using demo version of TCP-Com software to allow my PC to actas a server to which my Socket Client program on the Iseries can connect to
and communicate with.
I'm not familiar with TCP-Com software, but it sounds like a proxy of
sorts to allow you to use TCP/IP communications to communicate with an
RS-232 device. FWIW, there are also hardware devices that do this,
small devices you can plug into the RS-232 port of whatever machine
requires the RS-232 communications (I've used them on printers and
scales) and then you plug into ethernet on the other end, and it acts as
an TCP/IP server, eliminating the need for the PC. Might be worth
considering.
I am using the CLIENTEX1 tutorial program as a base for my personalsocket client program with the major changes being no entry parameters and
no receiving of data (For now I simply want to write to a single register
and get something to happen on the device).
There is no concept of a "register" in TCP/IP programming. I'm guessing
that this is specific to the particular machine you are talking to
("Modbus"? whatever that is.)
I would not recommend using CLIENTEX1 as a base for anything. It is
meant to be a very beginner example, to allow you to understand some
basic ideas of TCP/IP programming. Subsequent examples build on this,
making it more robust.
When I run my program I have confirmed that the connection isestablished and program runs all the way from beginning to end but nothing
is actually happening with the device.
I believe the issue is with what I am sending (request variable) and I'munsure if I should even be performing translations to ASCII as well.
This depends on what the target machine is expecting to see. A TCP
channel is just a communications medium. It enables communication to
occur, but it doesn't tell you what specifically needs to be communicated.
Asking us whether your data needs to be in ASCII, or what to put in your
variable would be analogous to calling up your telephone provider (such
as AT&T or Verizon here in the USA) and asking them what language you
need to speak when you call your friend. They aren't going to know
that! You have to work it out with your friend.
Likewise, we aren't going to be able to tell you what you need to
send/receive to your Modbus device. You'll need to look in the docs for
the Modbus device, or work it out with someone who has expertise with
those devices.
Below is a sample of my program with further details. Does anyone haveany experience with this and can provide me with more direction?
I would like to send the value 1 to 16 bit input register 6302. My slaveID should be default 1.
Sorry, I have no idea what "16 bit input register 6302" is. Again, this
sounds device-specific. See above.
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.