Forum Migration Notice
Update (2026-01-21): The user forums are now in read-only mode pending the data migration.
Update (2026-01-12): The user forums will be put into read-only mode on the 21st of January, 00:00 CET, to prepare for the data migration.
We're transitioning to a more modern community platform by beginning of next year. Learn about the upcoming changes and what to expect.
Update (2026-01-12): The user forums will be put into read-only mode on the 21st of January, 00:00 CET, to prepare for the data migration.
We're transitioning to a more modern community platform by beginning of next year. Learn about the upcoming changes and what to expect.
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.7K RobotStudio
- 402 UpFeed
- 21 Tutorials
- 16 RobotApps
- 307 PowerPacs
- 407 RobotStudio S4
- 1.8K Developer Tools
- 251 ScreenMaker
- 2.9K Robot Controller
- 368 IRC5
- 92 OmniCore
- 8 RCS (Realistic Controller Simulation)
- 859 RAPID Programming
- 43 AppStudio
- 4 RobotStudio AR Viewer
- 19 Wizard Easy Programming
- 111 Collaborative Robots
- 5 Job listings
