Home Programming

Discussion

Left ArrowBack to discussions page
PrasannaPrasanna Posts: 56 Apprentice
Hi @matthewd92
a=socket_read_asci_float(6)
b=a[1]
Sometimes i did not receive a from socket so it shown as '?'  which defines 'not a number' i think. 

Please refer attachments of errors. 

When i wanted to run the program, i have to go and make it zero manually in order to run.
How to make it as zero when i receive such errors.
Note:i cannot use previous program values for some reasons. 

Comments

  • PrasannaPrasanna Posts: 56 Apprentice
    @matthewd92

    Gentle Reminder on this
  • matthewd92matthewd92 Founding Pro, Tactile Sensor Beta Testers Posts: 1,267 Handy
    The first return value in the list that is returned is the number of values returned, you can use this to check to see if there is anything returned.

    if a[0]>0:<br>&nbsp; b=a[1]<br>else<br>&nbsp;b=0<br>end<br>

Sign In or Register to comment.
Left ArrowBack to discussions page