1. Home
    1. Dashboard
    2. Search
  2. Forum
    1. Unresolved Threads
    2. Members
      1. Recent Activities
      2. Users Online
      3. Team Members
      4. Search Members
      5. Trophys
  3. Articles
  4. Blog
  5. Videos
  6. Jobs
  7. Shop
    1. Orders
  • Login or register
  • Search
This Thread
  • Everywhere
  • This Thread
  • This Forum
  • Articles
  • Pages
  • Forum
  • Blog Articles
  • Products
  • More Options
  1. Robotforum - Support and discussion community for industrial robots and cobots
  2. Forum
  3. Industrial Robot Support and Discussion Center
  4. KUKA Robot Forum
Your browser does not support videos RoboDK Software for simulation and programming
Visit our Mainsponsor
IRBCAM
Robotics Channel
Robotics Training
Advertise in robotics
Sponsored Ads

no more data/variables available

  • m.dinio
  • June 16, 2024 at 10:32 AM
  • Thread is Unresolved
  • m.dinio
    Reactions Received
    1
    Trophies
    2
    Posts
    61
    • June 16, 2024 at 10:32 AM
    • #1
    Code
     INT OFFSET, BCI
     DECL STATE_T SR_T, SC_T
     DECL MODUS_T MR_T 
     REAL TIMEOUT
    
     MR_T=#ABS
     TIMEOUT=10
     OFFSET=0
    COPEN(:SER_3,HANDLE)
    IF(HANDLE==0) THEN
        HALT
    ENDIF
    LOOP
    IF($DATA_SER3>0)THEN
     CREAD(HANDLE, SR_T, MR_T, TIMEOUT, OFFSET, "%r", BCI);
    ENDIF
    ENDLOOP
    Display More

    after runnig code this error show:

    no more data/variables available

    and program break.

  • hermann
    Reactions Received
    412
    Trophies
    9
    Posts
    2,624
    • June 16, 2024 at 1:40 PM
    • #2

    You must set offset to zero before every reading with cread.

  • m.dinio
    Reactions Received
    1
    Trophies
    2
    Posts
    61
    • June 16, 2024 at 2:35 PM
    • #3
    Quote from hermann

    You must set offset to zero before every reading with cread.

    i was set in declaration

  • panic mode
    Reactions Received
    1,296
    Trophies
    11
    Posts
    13,136
    • June 16, 2024 at 6:02 PM
    • #4

    you are missing the point...

    offset is incremented by number of characters received every time CREAD is processed so sooner or later you are going to run out of space (buffer array length). to receive again, you need to reset offset value. and this needs to be done over and over... right now your example shows that you reset it once but - you are using CREAD in a loop.

    consider moving line 8 just before line 15 so both are always executed in tandem.

    1) read pinned topic: READ FIRST...

    2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

    3) read 1 and 2

  • hermann
    Reactions Received
    412
    Trophies
    9
    Posts
    2,624
    • June 16, 2024 at 11:27 PM
    • #5

    INT OFFSET, BCI
    DECL STATE_T SR_T, SC_T
    DECL MODUS_T MR_T
    REAL TIMEOUT

    MR_T=#ABS
    TIMEOUT=10
    COPEN(:SER_3,HANDLE)
    IF(HANDLE==0) THEN
    HALT
    ENDIF
    LOOP
    IF($DATA_SER3>0)THEN

    OFFSET=0
    CREAD(HANDLE, SR_T, MR_T, TIMEOUT, OFFSET, "%r", BCI);
    ENDIF
    ENDLOOP

  • m.dinio
    Reactions Received
    1
    Trophies
    2
    Posts
    61
    • June 18, 2024 at 11:11 AM
    • #6

    thanks panic mode , hermann .

    how can i read from serial in binary format

  • panic mode
    Reactions Received
    1,296
    Trophies
    11
    Posts
    13,136
    • June 18, 2024 at 2:21 PM
    • #7

    you need to receive data, then parse what ever the data is.

    to receive data you need to create a buffer, open channel, fetch data from the channel into buffer, process what is in the buffer, clear buffer, fetch more data etc. the part you seem to be stack on is streaming... as received data is streaming in, you need to process what is already in the buffer and make room for next data to be received. this need to be carefully crafted in order to keep running... if you cannot process the received data in time, use handshaking. this allows you to tell to sender "hold on a minute, i am still busy...". and once you are ready, then negotiate to get some more data. either way this is not trivial. most examples are likely to be very basic. for this to be practical in any way or form, you will need to handle much more, including channel loss, restart etc.

    also you did not state what the received values are and what they are representing so there is no telling how to decode...

    1) read pinned topic: READ FIRST...

    2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

    3) read 1 and 2

  • m.dinio
    Reactions Received
    1
    Trophies
    2
    Posts
    61
    • June 18, 2024 at 5:39 PM
    • #8

    many thank panic mode

  • m.dinio
    Reactions Received
    1
    Trophies
    2
    Posts
    61
    • June 29, 2024 at 9:58 AM
    • #9

    sometimes cwrite command not send , why?

    i using cwrite in sps.src

  • MOM
    Reactions Received
    176
    Trophies
    7
    Posts
    1,424
    • June 29, 2024 at 3:54 PM
    • #10
    Quote from m.dinio

    how can i read from serial in binary format

    IN $Config.dat define the variables (here just examples)

    ; --- variables ---
    INT CNT
    REAL VALUES[6]

    In your program
    OFFSET_CR=0
    CREAD(HANDLE,SR_T,MR_T,TIMEOUT,OFFSET_CR,"%r%.6r",CNT,VALUES[])

  • m.dinio
    Reactions Received
    1
    Trophies
    2
    Posts
    61
    • June 29, 2024 at 9:49 PM
    • #11
    Quote from MOM

    IN $Config.dat define the variables (here just examples)

    ; --- variables ---
    INT CNT
    REAL VALUES[6]

    In your program
    OFFSET_CR=0
    CREAD(HANDLE,SR_T,MR_T,TIMEOUT,OFFSET_CR,"%r%.6r",CNT,VALUES[])

    thanks,but my problem is cwrite in sps.src

  • MOM
    Reactions Received
    176
    Trophies
    7
    Posts
    1,424
    • June 30, 2024 at 12:07 AM
    • #12

    In my post #10 I answered the question of your post #6
    from my point of view: question answered!

  • MOM
    Reactions Received
    176
    Trophies
    7
    Posts
    1,424
    • June 30, 2024 at 12:11 AM
    • #13
    Quote from panic mode

    offset is incremented by number of characters received every time CREAD is processed so sooner or later you are going to run out of space (buffer array length)

    This also is applied to your transmit buffer and I have not seen how your source code looks like.

  • hermann
    Reactions Received
    412
    Trophies
    9
    Posts
    2,624
    • June 30, 2024 at 8:41 AM
    • #14
    Quote from m.dinio

    sometimes cwrite command not send , why?

    i using cwrite in sps.src

    Not enough information for answering.

    You are mixing up different questions in one thread, that's not the best idea.

  • m.dinio
    Reactions Received
    1
    Trophies
    2
    Posts
    61
    • July 1, 2024 at 8:09 PM
    • #15

    this is part of my code

    sps.src

    Code
    loop
    
    IF (($OUT[1]==FALSE) and (o1f==false))THEN
    
    o1f=true
    
    CWRITE(HANDLE,SW_T,MW_T,"%s","A")
    
    OFFSET=0
    CREAD(HANDLE,SR_T,MR_T,TIMEOUT,OFFSET ,"%s", EMPTY)
    ENDIF
    endloop
    Display More
  • panic mode
    Reactions Received
    1,296
    Trophies
    11
    Posts
    13,136
    • July 1, 2024 at 8:47 PM
    • #16

    and...? what about it?

    it is incomplete so one cannot even tell if it would compile.

    and what is the problem? keep in mind not everyone has access to a robot, certainly one of that vintage. so whatever you do, or ask, better support it with your observations... state behavior, messages, data transmitted etc.

    did you read the manuals? according to CWRITE manual for KSS5.5 it is missing $CMD but manual for 4.1 does not use it. so what is your KSS version? also your o1f flag is never reset, so will let your IF statement only be processed once.

    but this is just program. are you sure that wiring and port configuration is correct? what is sending data that you are receiving? are you sure the port settings are the same? do you have a loopback adapter?

    if you do not have other device to talk to, it is practical to use loopback. basically it is just a DB9F connector with pins 2 and 3 connected to each other. the nice thing about this is that port settings are almost irrelevant, no external device to setup, and whatever you send comes back. so you can do the development in stages, have your code write something and make sure that this part compiles. then you can add code to read what you just sent... and program examples from manual should be piece of cake to try out.

    if talking to external device, you need proper cable. type of cable depends on type of device (DCE/DTE). you can have program that compiles and runs but if wiring is incorrect, this will go nowhere...

    1) read pinned topic: READ FIRST...

    2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

    3) read 1 and 2

  • MOM
    Reactions Received
    176
    Trophies
    7
    Posts
    1,424
    • July 1, 2024 at 10:09 PM
    • #17
    Quote from MOM

    This also is applied to your transmit buffer and I have not seen how your source code looks like.

    Using CWRITE you do not need to set an offset - my fault.

    But you must check the return code
    CREAD : SR_T
    CWRITE: SW_T

    I cannot find them in your code snippet (post #15)

  • MOM
    Reactions Received
    176
    Trophies
    7
    Posts
    1,424
    • July 1, 2024 at 10:15 PM
    • #18

    Hint:

    search for the document "CREAD CWRITE R4.1 07.02.00 en"

Advertising from our partners

IRBCAM
Robotics Channel
Robotics Training
Advertise in robotics
Advertise in Robotics
Advertise in Robotics

Job Postings

  • Anyware Robotics is hiring!

    yzhou377 February 23, 2025 at 4:54 AM
  • How to see your Job Posting (search or recruit) here in Robot-Forum.com

    Werner Hampel November 18, 2021 at 3:44 PM
Your browser does not support videos RoboDK Software for simulation and programming

Tag Cloud

  • abb
  • Backup
  • calibration
  • Communication
  • CRX
  • DCS
  • dx100
  • dx200
  • error
  • Ethernet
  • Ethernet IP
  • external axis
  • Fanuc
  • help
  • hmi
  • I/O
  • irc5
  • IRVIsion
  • karel
  • kawasaki
  • KRC2
  • KRC4
  • KRC 4
  • krc5
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • roboguide
  • robot
  • robotstudio
  • RSI
  • safety
  • Siemens
  • simulation
  • SPEED
  • staubli
  • tcp
  • TCP/IP
  • teach pendant
  • vision
  • Welding
  • workvisual
  • yaskawa
  • YRC1000

Thread Tag Cloud

  • abb
  • Backup
  • calibration
  • Communication
  • CRX
  • DCS
  • dx100
  • dx200
  • error
  • Ethernet
  • Ethernet IP
  • external axis
  • Fanuc
  • help
  • hmi
  • I/O
  • irc5
  • IRVIsion
  • karel
  • kawasaki
  • KRC2
  • KRC4
  • KRC 4
  • krc5
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • roboguide
  • robot
  • robotstudio
  • RSI
  • safety
  • Siemens
  • simulation
  • SPEED
  • staubli
  • tcp
  • TCP/IP
  • teach pendant
  • vision
  • Welding
  • workvisual
  • yaskawa
  • YRC1000

Similar Threads

  • Cell with a large number of P Variables - YRC1000

    • Woebot
    • April 18, 2022 at 8:40 AM
    • Yaskawa Motoman Robot Forum
  • Message Communcation with PROFINET (or Ethernet/IP)?

    • paranoidandroid
    • August 30, 2022 at 5:56 PM
    • Yaskawa Motoman Robot Forum
  • What is the correct way to get coordinates from external device ?

    • Zadok the priest
    • April 21, 2022 at 8:10 AM
    • KUKA Robot Forum
  • Commanding LR-Mate with python scripts

    • mahboobelahi93
    • September 15, 2021 at 10:09 AM
    • Fanuc Robot Forum
  • Kuka robot project and difficulties

    • Oatesy
    • December 17, 2020 at 5:59 AM
    • KUKA Robot Forum
  • Questions about AS features by KRL programmer

    • Mentat
    • November 25, 2020 at 9:24 PM
    • Kawasaki Robot Forum
  • programming strategies transmitting variables

    • JuEdir
    • November 27, 2020 at 8:05 AM
    • KUKA Robot Forum
  • Arrays of Points

    • Eragorn
    • October 14, 2020 at 7:25 PM
    • Kawasaki Robot Forum

Tags

  • KUKA
  • serial
  1. Privacy Policy
  2. Legal Notice
Powered by WoltLab Suite™
As a registered Member:
* You will see no Google advertising
* You can translate posts into your local language
* You can ask questions or help the community with your knowledge
* You can thank the authors for their help
* You can receive notifications of replies or new topics on request
* We do not sell your data - we promise

JOIN OUR GREAT ROBOTICS COMMUNITY.
Don’t have an account yet? Register yourself now and be a part of our community!
Register Yourself Lost Password
Robotforum - Support and discussion community for industrial robots and cobots in the WSC-Connect App on Google Play
Robotforum - Support and discussion community for industrial robots and cobots in the WSC-Connect App on the App Store
Download