plcforum.uz.ua

International PLC Forum
It is currently Mon May 29, 2017 1:12 am

All times are UTC + 3 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Fri Mar 05, 2010 10:11 am 

Joined: Fri Mar 05, 2010 10:01 am
Posts: 1
Hello,

I'm looking for an example to communicate with simotion D435 and VB.NET through TCP/IP without OPC.

I have set up the D435 as TCP-server and use the VB.NET application as TCP/IP client.

This is no problem but i can't send DINT or reals, only bool and INT.
I can't figure out where the problem is situated. In the D435 or in VB.NET or in both?

Can somebody help me with this.

Best regards

Peter

Example D435
Code:
        MyByte:=_byte_from_8bool(bit0:=v_send.woord5_Bit0,
                                 bit1:=v_send.woord5_bit1,
                                 bit2:=v_send.woord5_bit2,
                                 bit3:=v_send.woord5_bit3,
                                 bit4:=v_send.woord5_bit4,
                                 bit5:=v_send.woord5_bit5,
                                 bit6:=v_send.woord5_bit6,
                                 bit7:=v_send.woord5_bit7);
                 DATASEND:=ANYTYPE_TO_BIGBYTEARRAY(MyByte,4);                 
//6. Integer 1
                 DATASEND:=ANYTYPE_TO_BIGBYTEARRAY(v_send.int1,5);

IF vopenserver.clientaddress[0] = 192 THEN
            myRetDINT :=
            _tcpsend(
            connectionid := vopenserver.connectionId
            ,nextcommand := immediately
            ,datalength := LENGTH_DATA
            ,data := DATASEND);
           
        END_IF;


Example VB.NET 2003
Code:
            BytesRead = client.GetStream.EndRead(ar)
            If BytesRead < 1 Then
                Exit Sub
            End If

            Dim clientdata As String = Encoding.ASCII.GetString(readBuffer)

            Dim s As String
            s = binair(readBuffer(0), 8)

            Dim intValue, b1, b2 As String
            b1 = binair(readBuffer(1), 8)
            b2 = binair(readBuffer(2), 8)
            intValue= b1 & b2
            intValue= Bin_To_Dec(intValue)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 3 hours


Who is online

Users browsing this forum: No registered users and 2 guests


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

Search for:
Jump to:  
Powered by International PLCforum® Forum Software © PLCforum
Mobile version