Byte to bit conversion in RobotStudio
JHesse
✭
in RobotStudio
Hello,<br><br>I am using OPC smart component in RobotStudio to receive digital signals from an OPC server. This works fine although the number of signals that can be used in the OPC smart component seems to be limited. Now, my idea is not to transmit single bits but bytes. Therefore I need to do a byte to bit conversion in RobotStudio so that I can use the single bits in my program.<br>Does anyone know how I can do this? Maybe by using group inputs?<br><br><br>Thank you<br>Kind regards,<br><br>Jonas
0
Comments
-
<div><font face="Arial, Verdana"><span style="font-size: 10pt; line-height: normal;">I don't know anything about OPC SC but:</span></font></div><font face="Arial, Verdana"><span style="font-size: 10pt; line-height: normal;">You can use BitCheck(data,bit) if you want to check a bit in a num value. </span></font><div style="font-family: Arial, Verdana; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"><br></div><div style="font-family: Arial, Verdana; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">something like:</div><div><div><font face="Arial, Verdana"><span style="font-size: 13.3333330154419px; line-height: normal;">PROC testGroupe()</span></font></div><div><font face="Arial, Verdana"><span style="font-size: 13.3333330154419px; line-height: normal;"> CONST num bitNo:=3;</span></font></div><div><font face="Arial, Verdana"><span style="font-size: 13.3333330154419px; line-height: normal;"> VAR num tmp;</span></font></div><div><font face="Arial, Verdana"><span style="font-size: 13.3333330154419px; line-height: normal;"> VAR bool bBitCheck;</span></font></div><div><font face="Arial, Verdana"><span style="font-size: 13.3333330154419px; line-height: normal;"> </span></font></div><div><font face="Arial, Verdana"><span style="font-size: 13.3333330154419px; line-height: normal;"> tmp:=giTestGroupe;</span></font></div><div><font face="Arial, Verdana"><span style="font-size: 13.3333330154419px; line-height: normal;"> bBitCheck:=BitCheck(tmp,bitNo);</span></font></div><div><font face="Arial, Verdana"><span style="font-size: 13.3333330154419px; line-height: normal;">endproc</span></font></div></div>0
-
Ehm is it only my view that is filled with <Html> code?0
-
svoldgaard wrote: »Ehm is it only my view that is filled with <Html> code?
<br><br>No, it's been happening all over the forum for a quite a while....<br>0 -
Thank you for your answer!<br>I can see the html code as well...<br>I've hoped that there is a smart component for getting single bits of a byte but I will try your solution.<br><br>Best regards,<br>Jonas<br>0
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 316 IRC5
- 61 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 800 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings