1072 advice

Supporting Java SE version 7 and up
charleshuff1953

1072 advice

Postby charleshuff1953 » Wed Apr 20, 2011 2:27 pm

I managed to write a gui for the 8/8/8 Interface Kit, the 1045 temp sensor IR, and the 1063 stepper controller all in one program - by following the examples given. The client is very happy and asked me how much to put this on a 1072 sbc2 so that the computer could be spared from the harsh working environment conditions by working over the lan or by wireless. Is this possible to do in Java with Netbeans? Would it mean replacing the software buttons with hardware pushbutton switches? Would the sbc2 run the java code directly? or how would the remote computer interact with the sbc2? currently the data is saved in comma delimited format for import into other software. The Gui is very simple - emergency stop, calibrate, run sample, go to top, go to bottom. These are the only buttons. what additional device is needed to make this work wireless?

Thanks for any advice...

erik
King of the Lab
Posts: 476
Joined: Fri Mar 06, 2009 12:42 pm
Location: Calgary, Canada
Contact:

Re: 1072 advice

Postby erik » Wed Apr 20, 2011 3:21 pm

To communicate with the SBC2 from a remote computer, you can connect the SBC2 to a router (or directly to the computer) with either Ethernet cable or using a wireless adapter. You will have to set up and enable the webservice on the SBC2.

The quickest and easiest way would be that the Phidgets attached to the SBC2 are opened using the openRemote() method instead of the open() method. That is pretty much the only change needed in the Java program. This will require the remote computer running the Java program to communicate with the SBC2. Pretty much all of the processing is done on the remote computer.

The other way would be to have the program running directly on the SBC2 and using the Dictionary to set up a Server-Client communication. The remote computer would send changes to the Keys and the SBC2 program would listen to the keys and then implement the emergency stop, etc, commands. The SBC2 would also send the recent data to the Dictionary which the remote computer would store as csv. This would allow all (or most) of the processing to be done on the SBC2.

charleshuff1953

Dictionary Example?

Postby charleshuff1953 » Sat Apr 23, 2011 7:18 pm

Is there an example of the web service/dictionary? I can see the interface kit 8/8/8 example has calls to openRemote... I have not been able to find any specific example for the 1072? I am thinking about ordering a 1072 device but wanted to look over some example code first. Are the dictionary key/values already for the most part in place? I am not sure why I would need to add key/value pairs let alone have them be retained?
I believe that I would be 'listening' for the key/value changes? An example would go a long way to helping me understand this and how it works.

thanks,
Charles

erik
King of the Lab
Posts: 476
Joined: Fri Mar 06, 2009 12:42 pm
Location: Calgary, Canada
Contact:

Re: 1072 advice

Postby erik » Tue Apr 26, 2011 11:16 am

Since the 1072 is a small stand-alone computer running Linux, you can compile/upload your Java application directly on it. So there isn't really any examples specifically controlling the 1072. If you haven't already, take a look at the Product Manual for the 1072.

The 1072 has an integrated 8/8/8 on-board. So using the on-board 8/8/8, the code for openRemote is the same as the 1018s. And you can still plug in the 1018 into the 1072.

Although I couldn't find any examples of using the Dictionary provided by us, one user did post a simple application located here: http://www.phidgets.com/phorum/viewtopic.php?f=7&t=4477

Adding your own key/value pairs would be a way to communicate your "emergency stop, calibrate, run sample, go to top, go to bottom" buttons from the PC to the program running on the 1072.

A way to test either of the options I described in the earlier post, without purchasing a 1072, would be to connect all the Phidgets to computer A, and run the program on computer B, provided the network is setup properly. If that works, then replace computer A with the 1072.


Return to “Java”

Who is online

Users browsing this forum: No registered users and 1 guest