CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum
Deutsche Version English version russian version 
It is currently Sat May 26, 2018 8:15 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Android sensors setup
PostPosted: Mon Jan 29, 2018 5:34 pm 
Offline

Joined: Fri Jan 19, 2018 10:40 pm
Posts: 4
Hello,

Has anyone had experience with the android sensors add on. I have a raspberry pi with codesys. I can't for the life of me get the android phone to send updated values to the codesys controller. If anyone has a basic example or has done this please show me the way.


Top
   
PostPosted: Mon Jan 29, 2018 7:50 pm 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 2671
Hi,
just use the Project from CODESYS store.
Install it here:

After install you'll find the project here:
"c:\Users\<YourWindowsUserName>\CODESYS Examples\SensorAppForAndroid\1.4.0.0\AndroidSensorApp.project"
-> then update the Project by rightclick to the project tree to your plc - set current compiler and current visu Profile.
one remark you need to remove the library netvarupd 3.5.5.0 from the Project (this seems to be a bug) it pulls automatcally current Version on compile after doing this.
BR
Edwin


You do not have the required permissions to view the files attached to this post.


Top
   
PostPosted: Mon Jan 29, 2018 9:32 pm 
Offline

Joined: Fri Jan 19, 2018 10:40 pm
Posts: 4
One problem I have been having with the example program is that it includes two devices, Datagenerator and receiver. Do I load both devices to the raspberry pi and which one do I run?


Top
   
PostPosted: Mon Jan 29, 2018 9:59 pm 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 2671
Hi,
You just need to download the second one... first one is only placeholder for the netvarlist.
BR
Edwin


Top
   
PostPosted: Tue Jan 30, 2018 4:56 am 
Offline

Joined: Fri Jan 19, 2018 10:40 pm
Posts: 4
Thanks for the help so far but I am still unable to get it to work. I am getting a bunch of errors when I try to download to the device. Lets say I wanted to create a new project and just monitor screen rotation. How would I go about setting that up?


Top
   
PostPosted: Tue Jan 30, 2018 7:34 pm 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 2671
Hi,
the most important is this list here:
This must 100% fit, because These liste is exactly used in the android app to send the values:
The upper Application is only a dummy application to have this list accessible as receive list.

//This gobal variable list is received via the network.
//Sender: NVL [SensorDataGenerator: PLC Logic: DataGenerator]
//Protocol: UDP

Code:
VAR_GLOBAL
   wVersion: WORD := 16#00_01;
   wCounter: WORD;
   dwFeatures: DWORD;
   Data: SensorValues;
   strCommand: STRING(70);
END_VAR


BR
Edwin


You do not have the required permissions to view the files attached to this post.


Top
   
PostPosted: Thu Feb 08, 2018 5:13 pm 
Offline

Joined: Fri Jan 19, 2018 10:40 pm
Posts: 4
Do I have to use the devices hotspot to connect the controller, or can they both just be on the same network interface?


Top
   
PostPosted: Mon Feb 12, 2018 7:28 pm 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 2671
Hi,
they need to be in the same network (android and plc)
BR
Edwin


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 8 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited