Okay, so as my programming experience is limited to about two years worth of programming in high school (about 5-6 years ago) building small "hello world" types of applications, network procedures are a little beyond my realm so I'm trying to learn as I go.
Probably the best way for me to explain this is to explain what I have going on and maybe you guys can help me out.
I have small network core processors on my network that do simple checks on equipment every so often and I am building a VB.Net application to allow the user to setup timed checking, check manually, and read results of equipment checks. The network core processors are running small C++ programs that simply run a multitude of general purpose I/O's. The programs on the core processors themselves are very simple and are required to be C++ because that is the native language of the core processors.
The major reason for my choice in VB is because I have the most experience with it and the UI for this program is rather involved. Seeing as my only C experience is console applications and I have NO experience in creating UI's with C++, unless what I am requesting can ABSOLUTELY not be done, I need to stick with VB.
So as it is, I need my VB.Net UI to be able to call C++ commands off of these modules over a closed network. I know DLL's are used to call functions in different languages but the ability for me to run a DLL on these modules, as far as I am aware, is impossible. So my question is basically: is there an easy way to call these functions on module having ip address 192.168.1.xxx?
Thanks for your help guys!
3 replies to this topic
#1
Posted 07 October 2011 - 03:36 PM
|
|
|
#2
Posted 22 October 2011 - 01:15 AM
I'm pretty sure that the software running on the external devices are not built for this sort of thing, therefore it would probably be a good idea to get them re-programmed so that they do.
I'd set up a TCP network that will transfer the data to and from them (Providing they all have different addresses). It's pretty simple to do and wouldn't take you too long on the VB side, it just means you'll also have to enable networking on the C++ side.
That's how I'd do it anyway, doesn't mean that's the only way..
I'd set up a TCP network that will transfer the data to and from them (Providing they all have different addresses). It's pretty simple to do and wouldn't take you too long on the VB side, it just means you'll also have to enable networking on the C++ side.
That's how I'd do it anyway, doesn't mean that's the only way..
#3
Posted 22 October 2011 - 05:44 PM
Yeah, my research has brought up that TCP would be the best. My biggest concern was simplicity. I need this program to be as fast as possible (within milliseconds or at least faster than the lag between each device) so the way to do it with the least lines of code for the program to run through would be best. So my initial thought was to handle all the networking on the C++ side, create a DLL to recognize the VB commands and translate them into network commands in C++.
As it turns out, not only is TCP simple but the protocol is language independent on simple commands. I just have to write the VB program to package a character or a string in a TCP packet, send the packet off, then tell the C++ program on the remote device to accept the packet and, based on the string it received, execute a command on its end. So there isn't any need for a DLL or any intermediate program at all.
As it turns out, not only is TCP simple but the protocol is language independent on simple commands. I just have to write the VB program to package a character or a string in a TCP packet, send the packet off, then tell the C++ program on the remote device to accept the packet and, based on the string it received, execute a command on its end. So there isn't any need for a DLL or any intermediate program at all.
#4
Posted 23 October 2011 - 05:55 AM
MasterFrmMO88 said:
Yeah, my research has brought up that TCP would be the best. My biggest concern was simplicity. I need this program to be as fast as possible (within milliseconds or at least faster than the lag between each device) so the way to do it with the least lines of code for the program to run through would be best. So my initial thought was to handle all the networking on the C++ side, create a DLL to recognize the VB commands and translate them into network commands in C++.
As it turns out, not only is TCP simple but the protocol is language independent on simple commands. I just have to write the VB program to package a character or a string in a TCP packet, send the packet off, then tell the C++ program on the remote device to accept the packet and, based on the string it received, execute a command on its end. So there isn't any need for a DLL or any intermediate program at all.
As it turns out, not only is TCP simple but the protocol is language independent on simple commands. I just have to write the VB program to package a character or a string in a TCP packet, send the packet off, then tell the C++ program on the remote device to accept the packet and, based on the string it received, execute a command on its end. So there isn't any need for a DLL or any intermediate program at all.
You're making this sound too over complicated. If you're starting networking for the first time, I suggest using VB. It'll help you a lot with the syntax and it also happily takes a GetStream which I believe other languages don't (Not too sure on this one). You need to try to not over complicated stuff for a simple task, all you're needing to do is connect two computers, send a string of data, send a response back. There's no packet control, merely just a TCP client accepting the stream. You should keep with TCP as TCP is the most reliable form of sending data (whether as UDP is un-reliable meaning you could quite easily get unexpected results).
Just set up a program to accept multiple clients, run a timer on the clients to get them to send the data when they feel like it (Maybe every 2 seconds or so) or possibly make it so the host has to send the clients a command before it sends them data - Whichever you prefer.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account

Back to top









