Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.

sayantan

Member Since 04 Feb 2014
Offline Last Active Mar 16 2014 05:36 AM
-----

Posts I've Made

In Topic: NetDuino+ RS485 Industrial Communications

02 March 2014 - 08:45 AM

Hi there, Have you ever needed Modbus RTU using Netduino+ over a RS-485 network? Or do you need a Netduino with RS-485? Do it inexpensively with MAX483 connected directly to COM1 on the Netduino. Do you need a TCP to Serial Converter? You can do it with Netduino+ and the MAX483. Max483 works like a transceiver. The attached code allows to switch to transmit a Modbus message and turns on the receiver to catch the reply.

Hi caestrada,

i was trying out ur coding for my netduino plus 1 and rs485 communication, but while deploying the code its showindg

"Error 1 'System.IO.Ports.SerialPort' does not contain a definition for 'ReadByte' and no extension method 'ReadByte' accepting a first argument of type 'System.IO.Ports.SerialPort' could be found (are you missing a using directive or an assembly reference?) C:\Users\CSIO\Documents\Visual Studio 2010\Projects\ceNetduinoPlusModbusRTU42\ceNetduinoPlusModbusRTU42\Program.cs 277 40 ceNetduinoPlusModbusRTU42 "

this error, cn u pls help me to over come dis problem.

thank you.


In Topic: First steps: SerialPort problem

23 February 2014 - 04:31 AM

 

using System; 
using System.Net;
using System.Text;
using System.IO.Ports;
using System.Net.Sockets;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.NetduinoPlus;
 
namespace rs232
{
    public class Program
    {
        static SerialPort serial;
        static OutputPort Led = new OutputPort(Pins.ONBOARD_LED, false);
 
        public static void Main()
        {            
            // initialize the serial port for COM1 (using D0 & D1) 
 
            serial = new SerialPort("COM1",9600, Parity.None, 8, StopBits.One);
            // open the serial-port, so we can send & receive data        
            serial.Open();
            // add an event-handler for handling incoming data        
            serial.DataReceived += new SerialDataReceivedEventHandler(serial_DataReceived);
 
 
            // wait forever...        
            Thread.Sleep(Timeout.Infinite);
        }
 
        static void serial_DataReceived(object sender, SerialDataReceivedEventArgs e)
        {
            int bytesToRead = serial.BytesToRead;
           
            //start reading the stream 
            if (bytesToRead > 0)
            {
                // get the waiting data 
                byte[] buffer = new byte[bytesToRead];
 
                serial.Read(buffer, 0, buffer.Length);
               
                serial.Write(buffer, 0, buffer.Length);
 
                Led.Write(true);
            }
 
            Led.Write(false);
        }// write your code here
     
    }
}// this is the code m using 
in hyperterminal, if i press a charecter, it gets  displays  one time and the onboard led blinks, bt it doesnt send back the data.

 

this is the coding i'm using.


In Topic: First steps: SerialPort problem

23 February 2014 - 04:30 AM

HI Chris, 

this is the shot of my set-up, but still i'm unable to communicate with pc. The netduino on-board led links when ever i press a botton from the keyboard.


In Topic: First steps: SerialPort problem

19 February 2014 - 09:27 AM

Hey Lifanek,

 

I gone through the [color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]thread u suggested and i tried out  the coding, its displaying only "[/color]transmit thread works" after every 5 sec

 

[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]I have a doubt that for receiving the output,  are u using any " hyperterminal software" or  any such software???[/color]

 

[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]Thank You..[/color]


In Topic: First steps: SerialPort problem

19 February 2014 - 09:19 AM

hello lifanek,

i'm really sorry first of all., i will definetly keep in mind what u said.

 

and yes i'm already using a [color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]MAX232 for PC communication (or USB to TTL)., [/color]

 

[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]i have an ADM3485 IC for RS485, will it work.????[/color]


home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.